简体   繁体   中英

NPM Install Errors

When running npm install I am getting an error that isn't reproducible on other computers. After installing everything and running webpack build it spews out an error. When looking at the directory webpack should have installed in it doesn't even exist. Is this a known npm install bug on mac?

Error when running npm install :

> www@ postinstall /Users/mackenzie/Desktop/omitted/www
> npm run webpack-build


> www@ webpack-build /Users/mackenzie/Desktop/omitted/www
> NODE_ENV=production ./node_modules/.bin/webpack -p --no-color

sh: ./node_modules/.bin/webpack: No such file or directory

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/7.4.0/bin/node" "/Users/mackenzie/Desktop/omitted/www/node_modules/.bin/npm" "run" "webpack-build"
npm ERR! node v7.4.0
npm ERR! npm  v3.10.9
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! www@ webpack-build: `NODE_ENV=production ./node_modules/.bin/webpack -p --no-color`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the www@ webpack-build script 'NODE_ENV=production ./node_modules/.bin/webpack -p --no-color'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the www package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=production ./node_modules/.bin/webpack -p --no-color
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs www
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls www
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mackenzie/Desktop/omitted/www/npm-debug.log

npm WARN www@ No license field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/7.4.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! www@ postinstall: `npm run webpack-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the www@ postinstall script 'npm run webpack-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the www package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run webpack-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs www
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls www

package.json

  "scripts": {
    "lint": "semistandard web/js/orders/* web/js/categories/* web/js/orders/* web/js/site/* web/js/user/*",
    "webpack-dev": "NODE_ENV=development ./node_modules/.bin/webpack --watch --progress",
    "webpack-build": "NODE_ENV=production ./node_modules/.bin/webpack -p --no-color",
    "postinstall": "npm run webpack-build"
  },
  "devDependencies": {
    "autoprefixer": "^6.5.2",
    "babel-core": "^6.18.2",
    "babel-loader": "^6.2.7",
    "babel-polyfill": "^6.16.0",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-react": "^6.16.0",
    "browser-sync": "^2.17.5",
    "browser-sync-webpack-plugin": "^1.1.3",
    "css-loader": "^0.25.0",
    "eslint": "^3.10.1",
    "eslint-config-semistandard": "^7.0.0",
    "eslint-config-standard": "^6.2.1",
    "eslint-config-standard-react": "^4.2.0",
    "eslint-loader": "^1.6.1",
    "eslint-plugin-promise": "^3.3.2",
    "eslint-plugin-standard": "^2.0.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.9.0",
    "less": "^2.7.1",
    "less-loader": "^2.2.3",
    "path": "^0.12.7",
    "postcss-loader": "^1.1.0",
    "semistandard": "^9.0.0",
    "style-loader": "^0.13.1",
    "url-loader": "^0.5.7",
    "webpack": "^1.13.3",
    "webpack-dev-middleware": "^1.8.4",
    "webpack-hot-middleware": "^2.13.1"
  },
  "dependencies": {
    "i": "^0.3.5",
    "lodash": "^4.16.6",
    "npm": "^3.10.9",
    "react": "^15.3.2",
    "react-addons-css-transition-group": "^15.3.2",
    "react-dom": "^15.3.2"
  }

NPM picked is different

npm ERR! npm  v3.10.9
npm ERR! npm  v4.0.5

Try: sudo npm install --unsafe-perm=true --allow-root

suggested by external link to solution

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM