【发布时间】:2018-04-09 08:40:23
【问题描述】:
当我输入 npm start 时出现以下错误;
npm ERR! Linux 4.4.0-109-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
以下 package.json 在另一台服务器上工作。我尝试将我的 nodejs 应用程序部署到另一台服务器。我成功安装了 nodejs 和 npm。
注意:安装 npm 后,我的项目文件夹下没有 node_modules 文件夹。
我的 package.json 文件是这样的;
{
"name": "myapplication",
"version": "1.0.0",
"description": "myapplication",
"main": "index.js",
"scripts": {
"test": "mocha",
"dev": "pm2 start ecosystem.config.js",
"pro": "pm2 start ecosystem.config.js --env production"
},
"author": "",
"license": "ISC",
"dependencies": {
"apn": "2.1.5",
"async": "2.5.0",
"body-parser": "1.17.2",
"bootstrap": "3.3.7",
"callback2promise": "1.0.3",
"cookie-parser": "1.4.3",
"express": "4.15.4",
"express-session": "1.15.5",
"geolib": "2.0.23",
"image-type": "3.0.0",
"jsonwebtoken": "7.4.3",
"jimp": "0.2.28",
"mkdirp": "0.5.1",
"mongoose": "4.11.9",
"morgan": "1.8.2",
"multer": "1.3.0",
"node-gcm": "0.14.6",
"nodemailer": "4.1.0",
"shortid": "2.2.8",
"socket.io": "2.0.3",
"socket.io-redis": "5.2.0",
"twitter": "1.7.1",
"underscore-node": "0.1.2",
"bcrypt": "1.0.3"
},
"devDependencies": {
"eslint": "4.5.0"
}
}
【问题讨论】:
-
你想用
npm start做什么?然后你需要创建一个start脚本。正如消息告诉你的那样......你只有test、dev和pro。 -
@eisbehr 我想下载模块。现在没有 node_modules 文件夹。没有 npm start 怎么下载?同一个文件在另一台服务器上工作
-
你需要使用
npm install,而不是npm start!
标签: node.js npm node-modules