2016-06-09 26 views
1

Ich erstelle eine einfache npm Uhr zu sehen und eine Sass-Datei zu generieren.NPM - npm Uhr funktioniert nicht

Ich habe diesen Code

{ 
     "name": "npm-test", 
     "version": "1.0.0", 
     "description": "", 
     "main": "index.js", 
     "scripts": { 
     "scss": "node-sass --output-style compressed -o css/output css/*scss", 
     "watch": "watch 'npm run scss' css/*.scss" 

     }, 
     "author": "", 
     "license": "ISC", 
     "devDependencies": { 
     "node-sass": "^3.7.0", 
     "watch": "^0.18.0" 
     } 
    } 

Ich erhalte diesen Fehler

> [email protected] watch /Users/ch-d/Desktop/npm-test 
    > watch 'npm run scss' css/*.scss 

    > Watching css/main.scss 
    /Users/ch-d/Desktop/npm-test/node_modules/watch/main.js:73 
     if (err) throw err; 
        ^
    Error: ENOTDIR, scandir 'css/main.scss' 
     at Error (native) 

    npm ERR! Darwin 15.4.0 
    npm ERR! argv "node" "/usr/local/bin/npm" "run" "watch" 
    npm ERR! node v0.12.4 
    npm ERR! npm v2.10.1 
    npm ERR! code ELIFECYCLE 
    npm ERR! [email protected] watch: `watch 'npm run scss' css/*.scss` 
    npm ERR! Exit status 1 
    npm ERR! 
    npm ERR! Failed at the [email protected] watch script 'watch 'npm run scss' css/*.scss'. 
    npm ERR! This is most likely a problem with the npm-test package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  watch 'npm run scss' css/*.scss 
    npm ERR! You can get their info via: 
    npm ERR!  npm owner ls npm-test 
    npm ERR! There is likely additional logging output above. 

    npm ERR! Please include the following file with any support request: 
    npm ERR!  /Users/ch-d/Desktop/npm-test/npm-debug.log  

kann ich 'npm Lauf SCSS' und das funktioniert laufen, aber die Uhr nicht

Antwort

2

Angenommen, Sie sind Unter Verwendung von wird nur ein Verzeichnisargument in der Befehlszeile und kein Dateiplatzhalter benötigt. Ich habe dies nur auf meinem eigenen System bestätigt ...

Sie können programmgesteuert sehen, um interessantere oder komplexere Dinge zu tun ... aber die CLI ist ziemlich einfach.

Sie können die Zeile in watch 'npm run scss' css/ ändern, oder Sie können in etwas Programmatischere wie ein Uhr-Skript oder etwas Komplexeres, wie ein Grunt-oder Schluck-basierten Ansatz suchen.