admin管理员组

文章数量:1328571

I'm working to setup node on a Windows pc. I'm new to this so figuring this out has been time consuming. The instructions I received were to do "npm install" and then "node index.js".

This is the error I received:

Error: Cannot find module 'qs'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous>(C:\Users\WLL\Desktop\Coding\WebDev_Code_Test\api\node_modules\express\lib\middleware\query.js:16:10)
    at Module._pile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

Any ideas where to start?

I'm working to setup node on a Windows pc. I'm new to this so figuring this out has been time consuming. The instructions I received were to do "npm install" and then "node index.js".

This is the error I received:

Error: Cannot find module 'qs'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous>(C:\Users\WLL\Desktop\Coding\WebDev_Code_Test\api\node_modules\express\lib\middleware\query.js:16:10)
    at Module._pile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

Any ideas where to start?

Share Improve this question edited Aug 1, 2017 at 14:10 Cœur 38.8k26 gold badges205 silver badges277 bronze badges asked Jun 17, 2017 at 12:22 W.L.AW.L.A 311 gold badge1 silver badge4 bronze badges 3
  • 2 Show your package.json please – Suren Srapyan Commented Jun 17, 2017 at 12:23
  • { "name": "site-code", "version": "1.0.0", "description": "API", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "private": true, "author": "", "license": "ISC", "dependencies": { "chance": "^1.0.4", "json-server": "^0.8.18", "qs": "^6.4.0", } } – W.L.A Commented Jun 17, 2017 at 12:35
  • Did you do npm install in the same folder as the package.json file? Also, next time just post the contents of the package.json in the original post itself, by editing it. – glhrmv Commented Jun 17, 2017 at 13:55
Add a ment  | 

2 Answers 2

Reset to default 4

npm install --save qs

and then run perhaps?

Just run this mand

rm -rf node_modules npm i

本文标签: javascriptCannot find module quotqsquotStack Overflow