简体   繁体   中英

Cannot load module I put manually in /node_modules/ directory

I want to use a module I put in /node_modules/ manually, I simply copy/pasted the files and installed dependencies with npm, I'm using NWJS 0.16.0.

When I type var speech = require('speech') in my app.js (or anywhere else), I get the following error - Uncaught Error: Cannot find module 'speech' .

I tried doing var speech = require('/node_modules/speech') , var speech = require('./node_modules/speech') and even full path C:\\\\...\\\\project\\\\node_modules\\\\speech with the same result.

If someone has an idea of what I might be doing wrong, I'd appreciate the input.

npm install -g ./speech yields no results

Note: this is the Google Cloud Speech API

尝试**npm install speech --save****npm install -g speech**

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM