italia / design-web-toolkit

Questa libreria è deprecata, si consiglia l'utilizzo di Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
Creative Commons Zero v1.0 Universal
93 stars 87 forks source link

Errore npm install #80

Closed andriensis closed 7 years ago

andriensis commented 7 years ago

Quando provo ad eseguire il comando "npm install" dopo aver seguito gli step della guida su come utilizzare l'ambiente di sviluppo, ottengo questo errore:

> ita-web-toolkit@1.0.0-alpha build C:\Users\Massimiliano\Documents\GitHub\ita-web-toolkit\ita-web-toolkit
> npm-run-all build:resources build:css build:js build:styleguide

C:\Users\Massimiliano\Documents\GitHub\ita-web-toolkit\ita-web-toolkit\node_modules\npm-run-all\bin\common\bootstrap.js:14
    const argv = process.argv.slice(2)
    ^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\Massimiliano\Documents\GitHub\ita-web-toolkit\ita-web-toolkit\node_modules\npm-run-all\bin\npm-run-all\index.js:13:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
npm ERR! weird error 8
gunzip commented 7 years ago

ciao @andriensis, aggiornare node a una versione >= 5.x dovrebbe risolvere il problema. integriamo nella documentazione le spec sulla versione richiesta.

andriensis commented 7 years ago

Grazie @gunzip ma node è già aggiornato

$ node --version
v0.10.13
gunzip commented 7 years ago

è una vecchia versione la 0.10.x. consiglio di scaricarne una aggiornata (6.x o 7.x) direttamente dal sito: https://nodejs.org/it/

andriensis commented 7 years ago

Ho provato a scaricare la versione aggiornata, sia la stabile 6.X che l'ultima 7.X, ma non la vedo effettivamente aggiornata da comando "node -v"

andriensis commented 7 years ago

Okay, sono riuscito ad aggiornare node alla 6.X, ma ora con "npm run build" ottengo altri errori:

> ita-web-toolkit@1.0.0-alpha build C:\Users\Massimiliano\Documents\GitHub\ita-web-toolkit\ita-web-toolkit
> npm-run-all build:resources build:css build:js build:styleguide

> ita-web-toolkit@1.0.0-alpha build:resources C:\Users\Massimiliano\Documents\GitHub\ita-web-toolkit\ita-web-toolkit
> shx mkdir -p build/src && shx cp -r src/vendor build/ && shx cp -r src/icons build/src/icons && shx cp src/_preview.tmpl build/index.html

"shx" non ▒ riconosciuto come comando interno o esterno,
 un programma eseguibile o un file batch.

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build:resources"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ita-web-toolkit@1.0.0-alpha build:resources: `shx mkdir -p build/src && shx cp -r src/vendor build/ && shx cp -r src/icons build/src/icons && shx cp src/_preview.tmpl build/index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ita-web-toolkit@1.0.0-alpha build:resources script 'shx mkdir -p build/src && shx cp -r src/vendor build/ && shx cp -r src/icons build/src/icons && shx cp src/_preview.tmpl build/index.html'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ita-web-toolkit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     shx mkdir -p build/src && shx cp -r src/vendor build/ && shx cp -r src/icons build/src/icons && shx cp src/_preview.tmpl build/index.html
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ita-web-toolkit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ita-web-toolkit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Massimiliano\Documents\GitHub\ita-web-toolkit\ita-web-toolkit\npm-debug.log
ERROR: "build:resources" exited with 1.

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ita-web-toolkit@1.0.0-alpha build: `npm-run-all build:resources build:css build:js build:styleguide`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ita-web-toolkit@1.0.0-alpha build script 'npm-run-all build:resources build:css build:js build:styleguide'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ita-web-toolkit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm-run-all build:resources build:css build:js build:styleguide
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ita-web-toolkit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ita-web-toolkit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Massimiliano\Documents\GitHub\ita-web-toolkit\ita-web-toolkit\npm-debug.log
gunzip commented 7 years ago

sembra che non trovi shx in node_modules. puoi provare rimuovendo la dir (node_modules) e rilanciando npm install prima della build ?

andriensis commented 7 years ago

Sono riuscito a risolvere ed ho "costruito" i vari file di stile. Ho un'ulteriore domanda: come funziona nel caso in cui dovessero esserci aggiornamenti su questo branch? Le modifiche che ho eventualmente apportato ai file build.css vengono eliminate? C'è bisogno di aggiornare manualmente in qualche modo i vari file tramite git o il tutto avviene automaticamente? Grazie mille del supporto.

gunzip commented 7 years ago

il consiglio è di non toccare i file del TK (a meno di non voler effettuare un fork, ma questo pregiudica qualsiasi tipo di upgrade a nuove versioni). build.css non dovrebbe esser manipolato direttamente, poiché viene creato al momento di ogni nuova build (npm build o npm watch). la modalità più corretta risulta quindi creare nuovi moduli (ovvero nuovi CSS, HTML, JS) e integrarli nella build secondo le indicazioni contenute in https://italia.github.io/ita-web-toolkit/docs/moduli.html questo permetterà di mantenere il TK aggiornato tramite git pull.

andriensis commented 7 years ago

Grazie mille per il supporto.