evenstensberg / webpack-scaffold-demo

Demo of a webpack-scaffold
MIT License
20 stars 2 forks source link

there was a error when exe webpack-cli init webpack-addons-demo #1

Closed apawn closed 6 years ago

apawn commented 6 years ago

I have made a trouble with executing 'webpack-cli init webpack-addons-demo ',

the error was

Error: Cannot find module '/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-addons-demo' at Function.Module._resolveFilename (module.js:485:15) at Function.require.resolve (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:162:23) at options.forEach.path (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/dist/init/index.js:28:38) at Array.forEach (native) at WebpackGenerator.initializing (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/dist/init/index.js:27:13) at Object. (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/yeoman-generator/lib/index.js:412:25) at /Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/run-async/index.js:25:25 at Promise () at /Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/run-async/index.js:24:19 at self.env.runLoop.add.completed (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/yeoman-generator/lib/index.js:413:11) at runCallback (timers.js:800:20) at tryOnImmediate (timers.js:762:5) at processImmediate [as _immediateCallback] (timers.js:733:5)

when i use webpack-addons-react , i also have met this .

so i am sure this is my fault, but couldn't know why, please help me .

thank you !

evenstensberg commented 6 years ago

Hi @apawn , let me investigate and get back to you later today! 👍

evenstensberg commented 6 years ago

Hey @apawn ! Do you call this command in a project where you have a package.json setup already? If not, could you tell me a bit about where you're running this from?

apawn commented 6 years ago

Hi @ev1stensberg , thans for your reply , there is no package.json file when i exe that command , there was a empty folder .

and this time, i call npm init first ,but also met the same problem .

➜ wktest npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults.

See npm help json for definitive documentation on these fields and exactly what they do.

Use npm install <pkg> --save afterwards to install a package and save it as a dependency in the package.json file.

Press ^C at any time to quit. package name: (wktest) version: (1.0.0) description: entry point: (index.js) test command: git repository: keywords: author: license: (ISC) About to write to /Users/xuyuanshuo.005/Documents/my-project/wktest/package.json:

{ "name": "wktest", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC" }

Is this ok? (yes) ➜ wktest webpack-cli init webpack-addons-demo yarn global v0.24.5 warning No license field [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... warning "babel-loader@7.1.2" has unmet peer dependency "webpack@2 || 3". [4/4] 📃 Building fresh packages... warning "webpack-addons-demo@1.5.0" has no binaries warning No license field ✨ Done in 2.95s. events.js:182 throw er; // Unhandled 'error' event ^

Error: Cannot find module '/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-addons-demo' at Function.Module._resolveFilename (module.js:485:15) at Function.require.resolve (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:162:23) at options.forEach.path (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/dist/init/index.js:28:38) at Array.forEach (native) at WebpackGenerator.initializing (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/dist/init/index.js:27:13) at Object. (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/yeoman-generator/lib/index.js:412:25) at /Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/run-async/index.js:25:25 at Promise () at /Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/run-async/index.js:24:19 at self.env.runLoop.add.completed (/Users/xuyuanshuo.005/.nvm/versions/node/v8.0.0/lib/node_modules/webpack-cli/node_modules/yeoman-generator/lib/index.js:413:11) at runCallback (timers.js:800:20) at tryOnImmediate (timers.js:762:5) at processImmediate [as _immediateCallback] (timers.js:733:5)

The version of main utils as list .

➜ wktest node -v v8.0.0 ➜ wktest npm -v 5.0.0 ➜ wktest webpack -v 3.5.3 ➜ wktest webpack-cli -v 2.0.1 ➜ wktest

thanks

apawn commented 6 years ago

it sames like the port was conficted .

evenstensberg commented 6 years ago

Did you fix the issue? Trying to repro locally, but mine works! skjermbilde 2017-12-28 kl 04 03 23

apawn commented 6 years ago

@ev1stensberg it doesn't work, but thank you anyway.