【问题标题】:Issue with NPM run Error 126 in Vue.js web appVue.js Web 应用程序中的 NPM 运行错误 126 问题
【发布时间】:2019-10-21 16:00:27
【问题描述】:

我正在尝试编译一个Vue.js 应用程序。但是,当我运行命令 npm run prod 时,我遇到了以下问题:

sh: /Users/antoinevandenheste/Downloads/magicfactory-1/node_modules/.bin/webpack: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! vue-piaf@2.0.2 prod: `webpack --config src/.webpack/prod.js`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the vue-piaf@2.0.2 prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/antoinevandenheste/.npm/_logs/2019-06-06T06_47_42_334Z-debug.log

我不知道问题是什么,但我似乎无法解决这个问题。任何帮助将非常感激。 Bellow 是我的 Package.json 中的代码。我也试过npm install和删除package-lock.json

package.json

{
  "name": "vue-piaf",
  "version": "2.0.2",
  "description": "Piaf - Vue 2 Bootstrap 4 Admin Dashboard Template",
  "main": "index.js",
  "scripts": {
    "dev": "webpack-dev-server --inline --history-api-fallback --progress --config src/.webpack/dev.js",
    "prod": "webpack --config src/.webpack/prod.js"
  },
  "keywords": [
    "Vue",
    "Vue 2",
    "Webpack 4"
  ],
...
}

【问题讨论】:

  • here 的任何答案有帮助吗?例如。重启后问题会消失吗?
  • 还没试过,但大部分都行不通

标签: html vue.js npm npm-install


【解决方案1】:

这对我有用。清除所有模块并重新安装。

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-15
    • 2018-05-11
    • 2014-09-27
    • 2017-10-22
    • 2017-08-30
    • 1970-01-01
    • 2018-09-18
    • 1970-01-01
    相关资源
    最近更新 更多