I started to work on a new project and I need to set up the environment. All the others team members work with a OS X environment while I'm using Ubuntu 14. The project is already working for them but I'm having problems setting up.
I'm getting this error when I try to run
$ gulp watch
Cannot find module 'React' from '/home/camilatigre/dev/kahuso/kahuso-ux/scripts/components/company/dashboard'`
And if I try to run browserify I also get a similar error:
$ browserify -t reactify ./scripts/app.jsx > app.js
Error: Cannot find module 'React' from '/home/camilatigre/dev/kahuso/kahuso-ux/scripts/components/company/dashboard'
at /home/camilatigre/.nvm/versions/node/v0.12.7/lib/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
at process (/home/camilatigre/.nvm/versions/node/v0.12.7/lib/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
at ondir (/home/camilatigre/.nvm/versions/node/v0.12.7/lib/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
at load (/home/camilatigre/.nvm/versions/node/v0.12.7/lib/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
at onex (/home/camilatigre/.nvm/versions/node/v0.12.7/lib/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
at /home/camilatigre/.nvm/versions/node/v0.12.7/lib/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:95:15)
I already tried to reinstall npm, nodejs, browserify, reactify, clean the node_modules folder and re-add all the packages but nothing works.
Any suggestions? :)
i found a solution. 2 archives were using a require('React') when it should be a lowercase r.
Related
So the host that I use for my discord bot died so I downloaded all the code and tried hosting it on my PC. But I get the following error.
Error: Cannot find module '/home/container/index.js
I've tried everything I can:
updated nodejs
reinstalled all my packages
Changed package.json
How can I fix this?
Cannot find module means you are trying to run non-existent file.
Ensure there is index.js in your working directory. If not,
Use cd to go to the directory where it is (usually it's src near the package.json)
Run node ./index.js
Many time people have just the problem of command line to run file,
as windows and linux have
different syntax to run .js file
i.e. node ./index.js for linux
and node .\index.js for windows
I am developing an electron application using the sqlite3 module and I have developed the code related to function separately now after everything is done now I am trying to import that separately developed module to my main.js file but it's throwing an error from require
Cannot find module 'E:\CSV-CONVERTOR\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node'
now I have tried so many solutions i'am attaching the solution I have tried below
1st one,
2nd one
3rd one
4th one
but still after trying everything still it's giving same errors this is the result
if there is any solution really appriceate the help!
var sqlite3 = require('sqlite3').verbose();
this is the import of the sqlite package witch working perfectly when i run
node process.js
this one is working perefectly but when i try to run this in main.js (in electron) it's gave me this errors
Ok after several searches I have found the method now first you have to run
npm install --save-dev electron-rebuild
then next you have to install sqlite3 if it's already installed you don't have to
npm install --save sqlite3
Then add this line to
package.json
Then run this line of code
"rebuild": "electron-rebuild -f -w sqlite3"
Now after doing this you will get a node in your sqlite lib
/.../node_modules/sqlite3/lib/binding/electron-v1.4-darwin-x64/node_sqlite3.node
the only thing that I had to do is the change the folder name most of the time it says electron-{your-version}-darwin-x64 instead of the actual version so you have to navigate to this path node_modules/sqlite3/lib/binding/ and rename according to you version mine was napi-v6-win32-x64 so you have to rename it
I've installed ts-node with NPM install, and tinkered with this for hours, I cant find any other documentation on the website as to why its not working. A quick google search has also turned up nothing; which is why I'm SURE its some small thing I'm missing. ts-node has also been installed globally AND in the project folder I'm getting the following error:
To import TypeScript files from quokka, `ts-node` module must be installed.
It is also recommended to install `tsconfig-paths` module for tsconfig.json paths mapping.
You may install the modules in your project or into quokka global folder by running `npm install ts-node tsconfig-paths` command inside the `~/.quokka/` folder.
at Module.load internal/modules/cjs/loader.js:653
at tryModuleLoad internal/modules/cjs/loader.js:593
at Function.Module._load internal/modules/cjs/loader.js:585
at require internal/modules/cjs/helpers.js:25
at Object.<anonymous> frontEnd/datrix/src/app/Logic/DeveloperTemplate.ts:1
at Module._compile internal/modules/cjs/loader.js:778
does anyone have some insight on how this can be done?
I figured it out, I had to open the project file in vs code, not the directory above it.
I just want to use it, I don't care about autocomplete and all the sugar..
In package.json
"module-x": "https://github.com/somerepo/module-x"
I then try to use it in my app.component.ts
import "module-x";
and it cannot be found in the project.
Angular 2 takes JS and TS modules just fine. It will have issues with angular 1 modules however.
My guess is that your module issues are that you never ran "npm install -s" so although the package json still has it, the actual module files were never installed/downloaded.
Do "npm install -s" in project folder
and then...
import {* or feature name} from "module_x";
I'm trying to deploy my project on Heroku. I've been able to heroku open the app and see it but I get a 404 on my bundle.js. The app is on github here. The app is on heroku here.
I've tried making sure my dependencies are all there regarding babel, babelify, grunt, etc. But I must be still missing something.
I don't get any errors after my git push heroku but I still get my 404.
I am able to recreate this locally as well. This is what I get when I run your postinstall script code:
$ npm run postinstall
> ncps-mms#0.0.0 postinstall ncps-mms
> gulp transpile --gulpfile client/gulpfile.babel.js
[00:18:43] Requiring external module babel-register
[00:18:43] Working directory changed to ncps-mms/client
(node:30276) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[00:18:43] Using gulpfile ncps-mms/client/gulpfile.babel.js
[00:18:44] Starting 'transpile'...
Error: Cannot find module './controllers/members-detail-controller' from 'ncps-mms/client/src'
[00:18:44] Finished 'transpile' after 184 ms
I see this error:
Error: Cannot find module './controllers/members-detail-controller' from 'ncps-mms/client/src'
The members-detail-controller is missing - See: https://github.com/gh0st/ncps-mms/tree/master/client/src/controllers.
If I comment out the following lines, https://github.com/gh0st/ncps-mms/blob/master/client/src/app.js#L4 and https://github.com/gh0st/ncps-mms/blob/master/client/src/app.js#L15 then run npm run postinstall again, the gulp tasks run without errors. I am then able to start the server without the 404's on bundle.js.