npm不会安装package.json依赖项

时间:2017-10-04 02:19:26

标签: javascript node.js npm

我一直在努力解决一个奇怪的错误。我尝试使用简单的npm i在我的服务器上安装项目依赖项,但它不会创建任何node_modules文件夹。

此外,我已经尝试了所有可能的解决方案,例如npm init,以便制作新的package.json文件或删除package-lock.json文件。

但是,package.json文件在我的本地环境中运行顺畅。

这是我的package.json文件:

{
  "name": "expressmvc",
  "version": "1.0.0",
  "description": "Webpack and Express backend boilerplate Edit",
  "main": "app.babel.js",
  "dependencies": {
    "axios": "^0.16.2",
    "babel-runtime": "^6.23.0",
    "bcrypt": "^1.0.3",
    "bluebird": "^3.5.0",
    "body-parser": "~1.16.0",
    "connect-mongo": "^1.3.2",
    "cookie-parser": "~1.4.3",
    "cron": "^1.3.0",
    "debug": "~2.6.0",
    "express": "~4.14.1",
    "express-session": "^1.15.5",
    "gmail-api-sync": "^1.2.8",
    "gmail-sender-oauth": "^1.0.5",
    "googleapis": "^21.3.0",
    "moment": "^2.18.1",
    "mongoose": "^4.9.2",
    "morgan": "~1.7.0",
    "node-cron": "^1.2.1",
    "nodemon": "^1.11.0",
    "passport": "^0.4.0",
    "passport-google-oauth20": "^1.0.0",
    "pug": "~2.0.0-beta10",
    "serve-favicon": "~2.3.2"
  },
  "devDependencies": {
    "babel-cli": "^6.24.0",
    "babel-core": "^6.26.0",
    "babel-eslint": "^8.0.0",
    "babel-loader": "^7.1.2",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-es2015": "^6.24.0",
    "babel-preset-es2016": "^6.22.0",
    "babel-preset-stage-2": "^6.24.1",
    "babel-register": "^6.26.0",
    "mocha": "^3.5.0",
    "prettier-eslint": "^8.1.0",
    "webpack": "^3.5.5"
  },
  "scripts": {
    "test": "mocha 'app/**/*.test.js' --compilers js:babel-core/register --recursive",
    "start": "NODE_ENV=production node ./build/backend.js",
    "run-dev": "DEBUG=express:* nodemon  ./app.js --exec babel-node",
    "build": "rm -f -r build && NODE_ENV=production webpack --config ./webpack.config.js --progress --profile --colors"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/PedramMarandi/express-js-boilerplate.git"
  },
  "keywords": [
    "expressjs",
    "boilerplate",
    "es6",
    "javascript",
    "MVC"
  ],
  "author": "Pedram Marandi",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/PedramMarandi/express-js-boilerplate/issues"
  },
  "homepage": "https://github.com/PedramMarandi/express-js-boilerplate#readme"
}

NPM版 3.10.10

节点版本 6.10.3

1 个答案:

答案 0 :(得分:-1)

此问题主要是由于Linux计算机上的权限问题。您可以在使用此命令更改部署文件夹的写入权限后尝试

sudo chmod -R 777 /home/nodejsAppFloder