Installed Mobile first CLI 7.0.0.0
When I try to open mfp cli it is giving the following error
broken cli but I guess
any fixes available in IBM Fix central
I tried to search but not able to find a fix for this
module.js:340
throw err;
^ Error: Cannot find module '/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/bin/mobilefirst-cli.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
The file it is reporting as "Cannot find" is a file packaged with the installable. You can cross check your downloaded contents and the installation steps by referring to the information here
https://developer.ibm.com/mobilefirstplatform/install/#clui
i faced same problem ... when you download CLI Zip from IBM site . first of all you need to Extract all not Run
like this picture
Related
I'm new to npm and I can't understand how to run a tutorial I found on GitHub. I suspect it has something to do with my lack of knowledge of npm
The tutorial is this one: https://github.com/IrfanBaqui/react-router-v4-tutorial
I'm on Windows 7.
I first tried running serving the index.html pages inside each folder via XAMPP... however, that didn't work (I just get a blank page).
Next, I tried navigating inside a folder via the command prompt and running npm start... that didn't work either... (I do have npm and node.js globally installed)
I get this error:
Cannot find module 'webpack'
at Function.Module._resolveFilename (module.js:469:1
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Documents\Downloads\Irfan Baqui react-router-v4-tutorial-m
ct_Components\server.js:2:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Advice would be appreciated.
Inside each sub folder you need to do
npm install it will install every lib you need.
npm start it will run the project
The server should be running. To access the site it should be localhost:9000
Well #sheplu has already answered your question. I would just like to let you know why it is needed.
It is a node project. The guys whose code you are trying to run have used many of the dependencies for each lesson (each folder in his repository).
what npm-install does is, download and resolves all the dependencies used in the project specified in the file named package.json. So, whenever you see a file package.json it would be there specifying dependencies for dev or prod environment.
So, run npm-install in the directory where you see package.json file.
There can be another file bower.json with the same purpose (listing the required dependencies). if you see bower.json, you should run bower-install in that case.
And finally the script to run the project. npm start in your case.
And the error you just posted is clearly saying that some-module not found or could not resolve or something like that. That is because, you've resolved the dependencies required, which you'll have to using npm-install or bower-install for package.json and bower.json respectively
I am trying to install restify but I am getting this error.
c:\Program Files\nodejs>npm install --save restify
module.js:471
throw err;
Error: Cannot find module 'c:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
can someone help?
It's not a restify problem. Check your environment variables if they're pointing to your valid local NodeJS bin-directory. Thats the place where your "npm-cli.js" should be.
How to set environment variables on different operating systems:
OSX:
Setting environment variables in OS X?
Windows:
https://www.computerhope.com/issues/ch000549.htm
Linux:
https://www.cyberciti.biz/faq/set-environment-variable-linux/
I am trying to use the Aurelia-cli tool to create a new Aurelia project. I am using a Windows 10 machine with node and git installed.
I created a new empty folder for the project, and opened a command prompt and navigated to this folder.
I then ran the following command which completed successfully:
npm install -g aurelia-cli
Then I ran the following to create a new project:
au new
But this gave the following error:
C:\Users\xxxx\AppData\Roaming\npm\node_modules\aurelia-cli\bin\aurelia- cli.js:3
const resolve = require('../lib/resolve');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Any ideas as to what would be causing this?
Make sure you have a compatible version of Node installed. You can check the your Node version with node -v.
Aurelia CLI is only compatible with Node >= 4.x
You can download a compatible version of Node from here.
This error was to do with the node version but it was not a process of simply downloading and installing the latest version. I got this working after going through the following steps:
Open the Node command prompt and upgrade the node version with:
npm cache clean
npm update -g
Still in the Node command prompt, go to the relevant directory and run
au new
And it worked fine.
Even after upgrading the node version as above, the version had not changed in the normal windows command prompt and the aurelia cli command still did not work from there. So this problem seems to be to do with node versions, windows, and my setup, rather than with the aurelia cli.
Hello I receive the following message when trying to install npm. I downloaded the most recent node.js but it doesn't seem to download npm. I keep getting the belowenter code here error message after deleting node.js and reinstalling it.
When I try installing node.js I don't see the following being created:
C:\Users\Efren Barragan\AppData\Roaming\npm
This is the first time installing node.js. I just installed it on my old computer and it worked out fine. I am new to this so so your patience is much appreciated! Thanks!
C:\Users\Efren Barragan> npm install npm -g
module.js:327
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at C:\Users\Efren Barragan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:19:13
at Object.<anonymous> (C:\Users\Efren Barragan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:75:3)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
Due to the bug in versions this is what i did -
I have faced the same issue in my Windows 10 PC. After looking into solutions, since i couldn't find the exact solution for the issue i was facing
Cannot find module 'npmlog'
I just uninstalled the node js and then, deleted both 'npm' and 'npm-cache' in
"C:\Users\YourPCName\AppData\Roaming"
Then, i downloaded the latest version of node from Node JS Website
And, installed node js
After that i checked with the path in environment variables.
Finally run the command prompt 'run as administrator' and npm install npm -g
Checking your version will show the latest version. 'npm -v'
I got the latest version - v3.10.9
Try this. this should work.
Install a newer version, it's been a bug in previous version.
I am attempting to run a simple node.js webserver using Cygwin. I copied the file into test.js after installing node and this is what I got.
$ node test.js
node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'posix'
at Function._resolveFilename (module.js:299:11)
at Function._load (module.js:245:25)
at require (module.js:327:19)
at Object.<anonymous> (/home/me/test.js:27:13)
at Module._compile (module.js:383:26)
at Object..js (module.js:389:10)
at Module.load (module.js:315:31)
at Function._load (module.js:276:12)
at Array.<anonymous> (module.js:402:10)
at EventEmitter._tickCallback (node.js:108:26)
user#host ~
$
Which version of node did you install? If you take a look at the node change log, require('posix') was moved into require('fs') in the API back in version 0.1.29 (2010.02.17). The gist is quite old.
I updated the code to the newest node.js build here: https://gist.github.com/862132 still I recommend finding other more recent example since this code is not that great (specially after I updated it).