Upgrading to Angular 6, error: "Refusing to delete" ... "is outside" ..."and not a link"
Upgrading to Angular 6, error: "Refusing to delete" ... "is outside" ..."and not a link"
我是第一次开发应用程序。我最初使用 Angular 5.2 构建它,我正在尝试升级到 Angular 6.
根据 https://update.angular.io/ 中的说明,我 运行 执行以下命令:
npm install -g @angular/cli
npm 安装@angular/cli
ng 更新@angular/cli
我收到一个错误 ("Could not find a package.json. Are you in a Node project?"),并意识到我可能应该在包含我的项目的目录中执行此操作。哎呀。同样,我对编码非常陌生。
所以我导航到我的项目目录并再次尝试。
虽然 运行 npm install @angular/cli 时,我收到以下错误:
npm ERR! Refusing to delete [MyProjectDirectory]/node_modules/.bin/ng: is outside [MyProjectDirectory]/node_modules/@angular/cli and not a link
npm ERR! File exists: [MyProjectDirectory]/node_modules/.bin/ng
npm ERR! Move it away, and try again.
以下是应用程序的实际托管版本(仍在 5.2 上,通过 GH 页面托管)以防有任何帮助:
https://opensocialsecurity.com/
任何关于我下一步应该做什么的意见都将不胜感激!
删除节点模块目录并重试。给定错误意味着 npm 无法删除它。
在您的项目目录中尝试此命令:
sudo rm -rf node_modules
我是第一次开发应用程序。我最初使用 Angular 5.2 构建它,我正在尝试升级到 Angular 6.
根据 https://update.angular.io/ 中的说明,我 运行 执行以下命令: npm install -g @angular/cli npm 安装@angular/cli ng 更新@angular/cli
我收到一个错误 ("Could not find a package.json. Are you in a Node project?"),并意识到我可能应该在包含我的项目的目录中执行此操作。哎呀。同样,我对编码非常陌生。
所以我导航到我的项目目录并再次尝试。
虽然 运行 npm install @angular/cli 时,我收到以下错误:
npm ERR! Refusing to delete [MyProjectDirectory]/node_modules/.bin/ng: is outside [MyProjectDirectory]/node_modules/@angular/cli and not a link npm ERR! File exists: [MyProjectDirectory]/node_modules/.bin/ng npm ERR! Move it away, and try again.
以下是应用程序的实际托管版本(仍在 5.2 上,通过 GH 页面托管)以防有任何帮助: https://opensocialsecurity.com/
任何关于我下一步应该做什么的意见都将不胜感激!
删除节点模块目录并重试。给定错误意味着 npm 无法删除它。 在您的项目目录中尝试此命令:
sudo rm -rf node_modules