node.js - Running webpack on Mac -


i have project uses webpack. run webpack, first installed node (v. 6.9.1) , npm (v. 3.10.8), used sudo npm install webpack -g install webpack globally. when try run webpack in project, says following error:

module.js:471     throw err;     ^  error: cannot find module 'webpack'     @ function.module._resolvefilename (module.js:469:15)     @ function.module._load (module.js:417:25)     @ module.require (module.js:497:17)     @ require (internal/module.js:20:19)     @ object.<anonymous> (/path/to/myproj/webpack.config.js:1:77)     @ module._compile (module.js:570:32)     @ object.module._extensions..js (module.js:579:10)     @ module.load (module.js:487:32)     @ trymoduleload (module.js:446:12)     @ function.module._load (module.js:438:3) 

i searched lot online, , best suggestion install locally. tried install locally, got error:

npm err! not package /path/to/myproj/webpack npm err! addlocal not install /path/to/myproj/webpack npm err! darwin 15.6.0 npm err! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "webpack" npm err! node v6.9.1 npm err! npm  v3.10.8 npm err! path /var/folders/zk/vhg127bn2b1g2vg4mfb941yr0000gn/t/npm-14256-797b3412/unpack-5c7f7eb6/package.json npm err! code enoent npm err! errno -2 npm err! syscall open  npm err! enoent enoent: no such file or directory, open '/var/folders/zk/vhg127bn2b1g2vg4mfb941yr0000gn/t/npm-14256-797b3412/unpack-5c7f7eb6/package.json' npm err! enoent enoent: no such file or directory, open '/var/folders/zk/vhg127bn2b1g2vg4mfb941yr0000gn/t/npm-14256-797b3412/unpack-5c7f7eb6/package.json' npm err! enoent not problem npm npm err! enoent , related npm not being able find file. npm err! enoent  npm err! please include following file support request: npm err!     /path/to/myproj/npm-debug.log 

so thought maybe have uninstall webpack first. did using sudo npm remove webpack -g, , tried install locally, still same error. time installing globally generate same error. not install webpack unless reinstalled node.

so why webpack package not found? how can install work?

thanks


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -