【发布时间】:2015-02-15 12:51:08
【问题描述】:
我只是想在官网上做第一个 angular.js 教程。当我尝试从我的项目目录运行 npm install 时,出现以下错误。
我的 package.json 文件如下所示。
{
"version": "0.0.0",
"private": true,
"name": "angular-phonecat",
"description": "A tutorial application for AngularJS",
"repository": "https://github.com/angular/angular-phonecat",
"license": "MIT",
"devDependencies": {
"karma": "^0.12.16",
"karma-chrome-launcher": "^0.1.4",
"karma-jasmine": "^0.1.5",
"protractor": "~1.0.0",
"http-server": "^0.6.1",
"tmp": "0.0.23",
"bower": "^1.3.1",
"shelljs": "^0.2.6"
},
"scripts": {
"postinstall": "bower install",
"prestart": "npm install",
"start": "http-server -a 0.0.0.0 -p 8000",
"pretest": "npm install",
"test": "node node_modules/karma/bin/karma start test/karma.conf.js",
"test-single-run": "node node_modules/karma/bin/karma start test/karma.conf.js --single-run",
"preupdate-webdriver": "npm install",
"update-webdriver": "webdriver-manager update",
"preprotractor": "npm run update-webdriver",
"protractor": "protractor test/protractor-conf.js",
"update-index-async": "node -e \"require('shelljs/global'); sed('-i', /\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/, '//@@NG_LOADER_START@@\\n' + cat('bower_components/angular-loader/angular-loader.min.js') + '\\n//@@NG_LOADER_END@@', 'app/index-async.html');\""
}
}
谁能帮我解决这个问题。谢谢。
【问题讨论】:
-
尝试不使用 sudo,本地项目包不需要它
-
@MichaelColeman 刚刚尝试过。但我得到了同样的错误:-(。
-
你应该得到一个名为
node_modules的文件夹,其中包含所有下载的包,你明白了吗? -
是的 node_modules 在我的项目文件夹中。