如何解决npm install命令不适用于Laravel 5.8版
我创建了一个Laravel 5.8项目,并且我想安装npm
。所以我输入了npm install
,但收到了以下消息:
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core,this package is dedicated to the legacy v1
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"12.18.3","npm":"6.14.6"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"x64"})
added 1055 packages from 500 contributors and audited 1058 packages in 149.498s
37 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them,or `npm audit` for details
所以我看到了这个question与我的问题有关,他说运行npm install @popperjs/core --save
命令,然后运行npm uninstall popper.js --save
以便安装Popper。
但是,只要我输入npm install @popperjs/core --save
,我就会收到以下消息:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"x64"})
+ @popperjs/core@2.5.2
added 1 package from 1 contributor and audited 1059 packages in 9.5s
38 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them,or `npm audit` for details
所以现在我真的不知道如何安装npm
,所以,如果您知道,请告诉我,我将不胜感激!
预先感谢...
更新#1:
这是我的package.json
:
{
"private": true,"scripts": {
"dev": "npm run development","development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js","watch": "npm run development -- --watch","watch-poll": "npm run watch -- --watch-poll","hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js","prod": "npm run production","production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},"devDependencies": {
"axios": "^0.19","bootstrap": "^4.1.0","cross-env": "^5.1","jquery": "^3.2","laravel-mix": "^4.0.7","lodash": "^4.17.13","popper.js": "^1.12","resolve-url-loader": "^2.3.1","sass": "^1.15.2","sass-loader": "^7.1.0","vue": "^2.5.17"
},"dependencies": {
"@popperjs/core": "^2.5.2"
}
}
更新2:
我删除了"popper.js": "^1.12",
和package.json
文件夹中的node_modules
并键入了npm install
,但是再次出现相同的错误!
解决方法
从 "popper.js": "^1.12",
删除package.json
行
然后删除node_modules
然后运行cmd npm install
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。