2017-02-11 175 views
0

我升級了node.js和npm,並執行了npm安裝,現在我得到下面的消息。問題是,我一直在應用程序上工作大約一年,安裝了gulp-sass(這是我用來升級我的sass文件),所以顯然是升級,但我不知道如何獲得一切再次開始,再次降級一切。升級node.js和離子後離子服務器不工作

$ ionic serve 
Uh oh! Looks like you're missing a module in your gulpfile: 
Cannot find module 'gulp-sass' 

Do you need to run `npm install`? 

當我嘗試npm install gulp-sass

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
npm WARN enoent ENOENT: no such file or directory, open 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\gulp-minify-css\package.json' 
npm WARN enoent ENOENT: no such file or directory, open 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\karma-junit-reporter\package.json' 
npm WARN enoent ENOENT: no such file or directory, open 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\karma-mocha-reporter\package.json' 
npm WARN [email protected] No repository field. 
npm WARN [email protected] No license field. 
npm ERR! Windows_NT 10.0.14393 
npm ERR! argv "C:\\Users\\Public\\Programs\\nodejs\\node.exe" "C:\\Users\\Someone\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp-sass" "--save" 
npm ERR! node v6.9.5 
npm ERR! npm v4.2.0 
npm ERR! path E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass 
npm ERR! code EPERM 
npm ERR! errno -4048 
npm ERR! syscall rename 

npm ERR! Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE' 
npm ERR!  at moveAway (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:42:5) 
npm ERR!  at destStatted (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:31:7) 
npm ERR!  at C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18 
npm ERR!  at FSReqWrap.oncomplete (fs.js:123:15) 
npm ERR! 
npm ERR! Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE' 
npm ERR!  at Error (native) 
npm ERR! { Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE' 
npm ERR!  at moveAway (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:42:5) 
npm ERR!  at destStatted (C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:31:7) 
npm ERR!  at C:\Users\Someone\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18 
npm ERR!  at FSReqWrap.oncomplete (fs.js:123:15) 
npm ERR! 
npm ERR! Error: EPERM: operation not permitted, rename 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\node-sass' -> 'E:\xampp\htdocs\cgf\rcredits-mobile\node_modules\.node-sass.DELETE' 
npm ERR!  at Error (native) parent: 'rcreditsmobile' } 
npm ERR! 
npm ERR! Please try running this command again as root/Administrator. 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\Someone\AppData\Roaming\npm-cache\_logs\2017-02-11T01_17_29_643Z-debug.log 
+1

您是否嘗試過'NPM緩存clean'? – Jackowski

回答

1

我發現了離子論壇問題的解答,相關部分下方是爲了清楚起見,一些修改:

只需添加到您的gulpfile.js

gulp.task('serve:before', ['default']); 

這條線告訴新的離子2客戶端運行舊的離子1.x客戶端 「默認」任務之前(運行離子發球之前)

此外,您需要添加您的ionic.config.json文件:

{ 
    ... 
    "app_id": "", 
    "v2": false, 
    "typescript": false, 
    "watch": { 
    "sass": ["scss/**/*.scss"], 
    "html": ["www/**/*.html"], 
    "livereload": [ 
     "www/**/*.html", 
     "www/**/*.js", 
     "www/**/*.css" 
    ] 
    } 
    ... 
} 

編號:https://forum.ionicframework.com/t/ionic2-cli-doesnt-run-gulp-tasks-on-ionic-serve/49085/7

0

我以前遇到過這個問題。我到目前爲止所嘗試的:

  1. 重新安裝node.js.你可以參考在命令行https://nodejs.org/en/download/
  2. 運行:npm rebuild node-sass

然後試試運行ionic serve。希望它可以幫助你。

+0

沒有,得到同樣的東西... – SomeoneElse