我刚刚用"sidemenu“模板生成了一个新的Ionic1应用程序。没有插件添加,没有额外的依赖。
我知道错误:
npm ERR! path C:\myApp\node_modules\.staging\cordova-android-dbc95b4b\node_modules\brace-expansion
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\myApp\node_modules\.staging\cordova-android-dbc95b4b\node_modules\brace-expansion' -> 'C:\myApp\node_modules\.staging\brace-expansion-7416809b'
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\myApp\node_modules\.staging\cordova-android-dbc95b4b\node_modules\brace-expansion' -> 'C:\myApp\node_modules\.staging\brace-expansion-7416809b'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\myApp\node_modules\.staging\cordova-android-dbc95b4b\node_modules\brace-expansion' -> 'C:\myApp\node_modules\.staging\brace-expansion-7416809b'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\nodejs\\fuckit\\node_modules\\.staging\\cordova-android-dbc95b4b\\node_modules\\brace-expansion',
npm ERR! dest: 'C:\\nodejs\\fuckit\\node_modules\\.staging\\brace-expansion-7416809b' },
npm ERR! stack: 'Error: EPERM: operation not permitted, rename \'C:\\nodejs\\fuckit\\node_modules\\.staging\\cordova-android-dbc95b4b\\node_modules\\brace-expansion\' -> \'C:\\nodejs\\fuckit\\node_modules\\.staging\\brace-expansion-7416809b\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\nodejs\\fuckit\\node_modules\\.staging\\cordova-android-dbc95b4b\\node_modules\\brace-expansion',
npm ERR! dest: 'C:\\nodejs\\fuckit\\node_modules\\.staging\\brace-expansion-7416809b',
npm ERR! parent: 'fuckit' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.我在powershell上作为管理员运行。
node 8.9.4
npm 5.1.0
cordova 8.0.0
ionic 3.19.1解决了(?):像其他4-5次我面对这个问题一样,我解决了,但我不知道如何解决。我只是尝试重新安装节点(v8和v9)、npm (不同版本)、cordova (不同版本)、nvm。在完全浪费了15小时之后,我解决了节点/npm环境的第4次完全刷新问题。NPM只不过是一场残酷的噩梦。
编辑:我怀疑我解决了问题,因为我将npm目录从
%APPDATA%/npm至
C:\Program Files\nodejs使用命令
npm config set prefix "C:\Program Files\nodejs"发布于 2018-02-22 13:02:39
令人惊讶的是,npm的GitHub问题页面上有几张解决您的问题的票。此外,我的一个队友今天也遇到了同样的问题,…因此,只需查看他们的问题页面或尝试其中一个建议的解决方案:
npm更新为较新的版本IDE,例如VSCode或Visual Studio和npm installnpm install中删除所有正在运行的节点实例https://stackoverflow.com/questions/48917484
复制相似问题