当前位置: 首页 > 知识库问答 >
问题:

更新Angular-CLI引发错误

徐柏
2023-03-14
ABC$ sudo npm install -g angular-cli@latest
npm WARN deprecated angular-cli@1.0.0-beta.28.3: angular-cli has been 
renamed to @angular/cli. Please update your dependencies.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 
3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/ng -> /usr/local/lib/node_modules/angular-cli/bin/ng

> fsevents@1.1.3 install /usr/local/lib/node_modules/angular-
cli/node_modules/fsevents
> node install

node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v51-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and node@7.8.0 (node-v51 ABI, unknown) (falling back to source compile with node-gyp) 
gyp ERR! clean error 
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js" "clean"
gyp ERR! cwd /usr/local/lib/node_modules/angular-cli/node_modules/fsevents
gyp ERR! node -v v7.8.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js clean' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/angular-cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Darwin 16.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/angular-cli/node_modules/fsevents
node-pre-gyp ERR! node -v v7.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Unable to save binary /usr/local/lib/node_modules/angular-cli/node_modules/node-sass/vendor/darwin-x64-51 : { Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/angular-cli/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:895:18)
at sync (/usr/local/lib/node_modules/angular-cli/node_modules/mkdirp/index.js:71:13)
at Function.sync (/usr/local/lib/node_modules/angular-cli/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/usr/local/lib/node_modules/angular-cli/node_modules/node-sass/scripts/install.js:111:11)
at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/node_modules/node-sass/scripts/install.js:154:1)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
Building: /usr/local/bin/node /usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli   '/usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@7.8.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:89:16
gyp verb `which` failed     at /usr/local/lib/node_modules/angular-cli/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /usr/local/lib/node_modules/angular-cli/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:114:15)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /usr/local/lib/node_modules/angular-cli/node_modules/which/which.js:89:16
gyp verb `which` failed     at /usr/local/lib/node_modules/angular-cli/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /usr/local/lib/node_modules/angular-cli/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:114:15)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at 

npm错误!代码ELIFECYCLE npm错误!错误1 npm错误!node-sass@4.6.1 postinstall:节点脚本/build.jsnpm错误!退出状态1 npm错误!npm错误!在node-sass@4.6.1postinstall脚本失败。npm错误!这可能不是NPM的问题。上面可能有额外的日志记录输出。

npm错误!此运行的完整日志可以在:npm err!/users/abc/.npm/_logs/2017-11-12t09_23_09_328z-debug.log

共有1个答案

壤驷瑾瑜
2023-03-14

您安装的CLI版本错误。

npm警告已被否决的angular-cli@1.0.0-beta.28.3:angular-cli已更名为@angull/cli。

您应该这样做:

npm uninstall -global angular-cli @angular/cli
npm install -global @angular/cli
 类似资料:
  • 问题内容: 我已经从https://nodejs.org/en/download安装了node ,然后使用NPM通过NPM安装了角度CLI 完成后,我然后尝试创建一个新的角度项目 我得到以下错误 我尝试使用sudo(和不使用sudo)安装cli,并重新安装了node:我总是遇到相同的错误。 我找不到任何人遇到这个问题。 我正在使用MacOS。 问题答案: 我按照步骤 更新节点,npm最新版本 删除

  • 我想使用MySQL5.7和MySQL Workbench6.2在表中插入一些行。当我尝试它时,我得到了错误1175(在安全更新模式下没有WHERE的更新)

  • 我最近从我的windows机器换成了iMac,我把我的angular项目复制到Mac上,并按照所有的安装说明操作,但现在当我键入NPM start时,项目开始了,但当我保存文件时并没有更新。 我已经卸载了angular-cli并将其安装到最新版本 角度-CLI:1 . 0 . 0-β21 节点:6.9.1 操作系统:达尔文x64 我也安装了守夜人,但没有成功。 我杀ng服的时候,网站直接给出错误

  • 当我试图通过使用命令ng new project-name创建新项目时,我得到了如下所示的错误: null

  • 我是npm和Angular 2的新手,我正在尝试使用Angular/CLI建立一个新的Angular 2项目。 我当前正在运行: Node V8.9.3 npm V5.6.0 Windows 10 首先,我运行,看起来安装得很好。然后我转到我想启动项目的文件夹,运行,但不断得到这个错误。 npm警告已弃用angular-cli@1.0.0-beta.22-1:angular-cli已重命名为@An

  • 我正在构建一个音乐会站点。目前我有一个事件索引页面和一个事件创建页面。创建事件后,我重定向回索引页面,但除非我刷新索引页面,否则新事件不会显示。我希望新事件在我提交/创建新事件后自动出现。我尝试在组件之间共享数据,但似乎不起作用。我真的不知道正确的方法是什么。 事件路由。单元ts event-create.component.ts 事件索引。组成部分ts event.service.ts