package.jsonがありますが、コマンドコンソールで実行しようとすると、次のエラーが発生します。
$ npm install
npm ERR! install Couldn't read dependencies
npm ERR! Windows_NT 5.1.2600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! Invalid version: "0.1"
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! F:\UwAmp\www\nodejs\express\npm-debug.log
これが私のpackage.jsonです
{
"name": "Express101",
"version": "0.1",
"description": "This is a practice demo for express node",
"main": "app.js",
"author": {
"name": "Juan Dela Cruz",
"email": "[email protected]"
},
"dependencies": {
"express": "^4.13.3",
"jade": "^1.11.0"
}
}
これを手伝ってくれませんか。バージョン部分にエラーがあるとのことです。
答えはエラーメッセージにあります:
npm ERR!無効なバージョン:「0.1」
あなたの中にpackage.json
、あなたはこれを持っています:
"バージョン": "0.1"、 `
semverの要件を満たすようにこれをフォーマットする必要があります(npm package.jsonのドキュメントとnode-semverリポジトリを参照してください)。0
前に(0.0.1
)を追加すると、エラーが消えるはずです。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加