学習:JavaScript #2:学習用プロジェクト作成

#2 JavaScriptの始め方 | Think IT(シンクイット)

(1) waterslideインストール
環境設定を楽にするためのコマンドラインツールをインストールする
C:\Windows\system32>npm install waterslide -g
npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated
C:\Program Files (x86)\Nodist\bin\ws -> C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\bin\ws
npm WARN lifecycle The node binary used for scripts is C:\Program Files (x86)\Nodist\bin\node.exe but npm is using C:\Program Files (x86)\Nodist\v-x64\10.16.3\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> phantomjs-prebuilt@2.1.16 install C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-windows.zip
Saving to C:\Users\user\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip
Receiving...
  [================================--------] 79%
Received 17767K total.
Extracting zip contents
Removing C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\phantomjs-prebuilt\lib\phantom
Copying extracted folder C:\Users\user\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip-extract-1570271228440\phantomjs-2.1.1-windows -> C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\phantomjs-prebuilt\lib\phantom
Writing location.js file
Done. Phantomjs binary available at C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe

> node-sass@4.12.0 install C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/win32-x64-64_binding.node
Download complete..] - :
Binary saved to C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\node-sass\vendor\win32-x64-64\binding.node
Caching binary to C:\Users\user\AppData\Roaming\npm-cache\node-sass\4.12.0\win32-x64-64_binding.node

> node-sass@4.12.0 postinstall C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
+ waterslide@0.9.2
added 289 packages from 253 contributors in 342.923s


   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │      New minor version of npm available! 6.9.0 -> 6.11.3       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.11.3   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯


(2) プロジェクト作成
D:\JavaScriptフォルダを作成・移動、wsコマンドでプロジェクトを作成
C:\Windows\system32>d:

D:\>md JavaScript

D:\>cd javascript

D:\JavaScript>ws new node jsproject
create a new project of node
wrote src/index.js
wrote .editorconfig
wrote .gitignore
wrote src/sample.test.js
wrote .eslintignore
wrote .eslintrc.json
wrote .babelrc
wrote package.json
wrote README.md
npm i innocentia ava eslint babel-eslint webpack babel-loader babel-core babel-loader babel-preset-env -D
Error: error 'npm i innocentia ava eslint babel-eslint webpack babel-loader babel-core babel-loader babel-preset-env -D' is failed. 1
    at ChildProcess.child.on (C:\Program Files (x86)\Nodist\bin\node_modules\waterslide\lib\setup\command.js:30:28)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

  project jsproject was created.
  see. jsproject/README.md

D:\JavaScript>

(3) プロジェクト実行
作成したプロジェクトを実行してみる
D:\JavaScript>cd jsproject

D:\JavaScript\jsproject>npm start
npm WARN lifecycle The node binary used for scripts is C:\Program Files (x86)\Nodist\bin\node.exe but npm is using C:\Program Files (x86)\Nodist\v-x64\10.16.3\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> jsproject@0.0.1 start D:\JavaScript\jsproject
> innocentia run

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'D:\JavaScript\jsproject\node_modules\innocentia\bin\innocentia'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jsproject@0.0.1 start: `innocentia run`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsproject@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2019-10-05T11_30_08_061Z-debug.log
→ エラーとなる…



[学習][JavaScript][Node.js][waterslide]

0 件のコメント:

その他の記事