material-components / material-components-web-codelabs

Codelabs for Material Components for Web (MDC Web)
MIT License
128 stars 101 forks source link

npm run start (material-components-web-codelabs-master) #92

Open Vad0k opened 5 years ago

Vad0k commented 5 years ago

lesson: https://codelabs.developers.google.com/codelabs/mdc-101-web/#1 do: del package.lock.json npm i results:

> fibers@4.0.1 install C:\Nodejs\localhost\material\material-components-web-codelabs\mdc-101\starter\node_modules\
fibers
> node build.js || nodejs build.js

`win32-x64-72` exists; testing
Binary is fine; exiting

> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Nodejs\localhost\material\material-components-web-codelabs\mdc-101\
starter\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch
":"any"} (current: {"os":"win32","arch":"x64"})

added 785 packages from 567 contributors and audited 10479 packages in 161.243s
found 4 vulnerabilities (1 low, 1 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

npm audit fix

npm run start

{
  "name": "mdc-101-web",
  "private": true,
  "version": "0.0.0",
  "scripts": {
    "start": "webpack-dev-server --progress"
  },
  "license": "MIT",
  "devDependencies": {
    "babel-core": "^6.22.1",
    "babel-loader": "^7.0.0",
    "babel-preset-env": "^1.7.0",
    "css-loader": "^3.0.0",
    "dart-sass": "^1.17.2",
    "extract-loader": "^1.0.2",
    "fibers": "^4.0.0",
    "file-loader": "^1.1.11",
    "sass-loader": "^7.1.0",
    "webpack": "^3.0.0",
    "webpack-dev-server": "^3.7.2"
  }
}

LOG:

info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Nodejs\\node.exe',
1 verbose cli   'C:\\Nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.10.0
3 info using node@v12.4.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle mdc-101-web@0.0.0~prestart: mdc-101-web@0.0.0
6 info lifecycle mdc-101-web@0.0.0~start: mdc-101-web@0.0.0
7 verbose lifecycle mdc-101-web@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle mdc-101-web@0.0.0~start: PATH: C:\Nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Nodejs\localhost\material\material-components-web-codelabs-master\mdc-101\starter\node_modules\.bin;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Boxstarter;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Common Files\Autodesk Shared\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\wamp64\bin\php\php5.6.38;C:\ProgramData\ComposerSetup\bin;C:\Symfony;C:\ProgramData\chocolatey\bin;C:\nwjs-sdk\;C:\Users\manakov\AppData\Roaming\npm\node_modules;C:\Nodejs\;C:\Users\manakov\AppData\Local\Microsoft\WindowsApps;C:\Users\manakov\AppData\Local\Programs\Git\cmd;C:\Users\manakov\AppData\Roaming\npm
9 verbose lifecycle mdc-101-web@0.0.0~start: CWD: C:\Nodejs\localhost\material\material-components-web-codelabs-master\mdc-101\starter
10 silly lifecycle mdc-101-web@0.0.0~start: Args: [ '/d /s /c', 'webpack-dev-server --progress' ]
11 silly lifecycle mdc-101-web@0.0.0~start: Returned: code: 1  signal: null
12 info lifecycle mdc-101-web@0.0.0~start: Failed to exec start script
13 verbose stack Error: mdc-101-web@0.0.0 start: `webpack-dev-server --progress`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:200:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:200:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid mdc-101-web@0.0.0
15 verbose cwd C:\Nodejs\localhost\material\material-components-web-codelabs-master\mdc-101\starter
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Nodejs\\node.exe" "C:\\Nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.4.0
19 verbose npm  v6.10.0
20 error code ELIFECYCLE
21 error errno 1
22 error mdc-101-web@0.0.0 start: `webpack-dev-server --progress`
22 error Exit status 1
23 error Failed at the mdc-101-web@0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Mazvangui commented 5 years ago

i have the same problem :/

abhiomkar commented 5 years ago

Can you try solutions provided in https://github.com/angular/angular/issues/13935 ? Seems related.

Mazvangui commented 5 years ago

I have found the solution. First try npm audit fix if this cmd does not fix vulnerabilities run npm audit this cmd will show you the dependencies that have vulnerabilities and if you follow the link that this cmd shows you, you will have more information for unaffected version. for me vulnerabilities were in:

  1. css-loader:^@@0.28.x I uninstalled this with npm uninstall --save-dev and I have installed the new version npm i css-loader --save-dev

  2. webpack-server-dev:^2.3.x I installed version 2.11.4 with npm i webpack-server-dev@2.11.4 --save-dev

After that, I ran npm i to see if I still have vulnerabilities. and now npm start works for me.