Npm packages not installing

while starting a project in typescript , it shows installing npm packages but after that it keeps on loading for 20-25 minuts and then give an error

Creating Ionic app in folder C:\Users\Ritesh\kalamapp based on tabs project
Downloading: https://github.com/driftyco/ionic2-app-base/archive/typescript.zip
Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/typescript.zip

Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall

i used this start command
Ionic start Myproject tabs --v2 --ts

npm is installed on my system
npm -v shows
3.8.1

What version of ionic CLI are you using?

use ionic -v to check. I had the same problem with beta-24.

I fixed it by upgrading the ionic CLI. Use npm install -g ionic@beta to update.

npm install -g ionic@beta

Is not working sir… I have beta.25 install as of now sir.
And its also not updating.

Can you suggest some other way?

What version of node do you have as well?

i have node version
node 4.4.3

also
when i am giving
npm install -g ionic@beta

it shows this message

C:\Users\Ritesh>npm install -g ionic@beta
C:\Users\Ritesh\AppData\Roaming\npm\ionic -> C:\Users\Ritesh\AppData\Roaming\npm\node_modules\ionic\bin\ionic
C:\Users\Ritesh\AppData\Roaming\npm
`-- ionic@2.0.0-beta.25

when i am giving npm install it shows this message

C:\Users\Ritesh>npm install
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Ritesh\package.json’
npm WARN Ritesh No description
npm WARN Ritesh No repository field.
npm WARN Ritesh No README data
npm WARN Ritesh No license field.

You might need to update your version of Node to a more recent 5x version.

Thank Sir …it solved the issue. :slight_smile:
YOU ARE THE BEST Sir @mhartington

but one thing is still there :sweat_smile:
npm install -g ionic@beta - dont update ionic to beta.26

shows

C:\Users\Ritesh>npm install -g ionic@beta
C:\Users\Ritesh\AppData\Roaming\npm\ionic -> C:\Users\Ritesh\AppData\Roaming\npm\node_modules\ionic\bin\ionic
C:\Users\Ritesh\AppData\Roaming\npm
`-- ionic@2.0.0-beta.25

Thats because there is no beta.26 of the ionic CLI :smile:

Beta.25 is the latest beta CLI at the moment.

ohh… :laughing:
thanks

Hi There,

I have recently installed ionic2 and have updated nodejs and npm.

I am trying to create a tabs project but unfortunately I am getting the same error.

@ishank Could you provide some more details, e.g. run ionic info and paste the output here?

@iignatov thanks for your reply.

Please find all the details below:

image

image

Also, after running ionic server I am getting the following error:

WARN: ionic.config.js has been deprecated, you can remove it.
Uh oh! Looks like you're missing a module in your gulpfile:
Cannot find module 'process-nextick-args'

Do you need to run `npm install`? 

After running npm install command i am getting following errors:

npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm
nd is now out of date with respect to npm
npm WARN prefer global node-gyp@3.3.1 should be installed with -g

> node-sass@3.6.0 install C:\Ishank-Workarea\Projects\Whirlpool\Screenshots\NEW
PP\node_modules\node-sass
> node scripts/install.js

Cannot download "https://github.com/sass/node-sass/releases/download/v3.6.0/win
2-ia32-14_binding.node":

tunneling socket could not be established, cause=getaddrinfo ENOTFOUND proxy.co
pany.com

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@3.6.0 postinstall C:\Ishank-Workarea\Projects\Whirlpool\Screenshots
NEWAPP\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files (x86)\nodejs\node.exe C:\Ishank-Workarea\Projects\Wh
rlpool\Screenshots\NEWAPP\node_modules\node-gyp\bin\node-gyp.js rebuild --verbo
e --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
gyp verb cli   'C:\\Ishank-Workarea\\Projects\\Whirlpool\\Screenshots\\NEWAPP\\
ode_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.3.1
gyp info using node@0.12.0 | win32 | ia32
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at F (C:\Ishank-Workarea\Projects\Whirlpool\Screens
ots\NEWAPP\node_modules\which\which.js:63:19)
gyp verb `which` failed     at E (C:\Ishank-Workarea\Projects\Whirlpool\Screens
ots\NEWAPP\node_modules\which\which.js:72:29)
gyp verb `which` failed     at C:\Ishank-Workarea\Projects\Whirlpool\Screenshot
\NEWAPP\node_modules\which\which.js:81:16
gyp verb `which` failed     at C:\Ishank-Workarea\Projects\Whirlpool\Screenshot
\NEWAPP\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Ishank-Workarea\Projects\Whirlpool\Screenshot
\NEWAPP\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:99:15)
gyp verb `which` failed  python2 [Error: not found: python2]
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at F (C:\Ishank-Workarea\Projects\Whirlpool\Screens
ots\NEWAPP\node_modules\which\which.js:63:19)
gyp verb `which` failed     at E (C:\Ishank-Workarea\Projects\Whirlpool\Screens
ots\NEWAPP\node_modules\which\which.js:72:29)
gyp verb `which` failed     at C:\Ishank-Workarea\Projects\Whirlpool\Screenshot
\NEWAPP\node_modules\which\which.js:81:16
gyp verb `which` failed     at C:\Ishank-Workarea\Projects\Whirlpool\Screenshot
\NEWAPP\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Ishank-Workarea\Projects\Whirlpool\Screenshot
\NEWAPP\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:99:15)
gyp verb `which` failed  python [Error: not found: python]
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PY
HON env variable.
gyp ERR! stack     at failNoPython (C:\Ishank-Workarea\Projects\Whirlpool\Scree
shots\NEWAPP\node_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Ishank-Workarea\Projects\Whirlpool\Screenshots\NEWAPP\
ode_modules\node-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:99:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Ishank-Workar
a\\Projects\\Whirlpool\\Screenshots\\NEWAPP\\node_modules\\node-gyp\\bin\\node-
yp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ld
lags=" "--libsass_library="
gyp ERR! cwd C:\Ishank-Workarea\Projects\Whirlpool\Screenshots\NEWAPP\node_modu
es\node-sass
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
Build failed
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsev
nts@1.0.11
npm WARN angular2@2.0.0-beta.15 requires a peer of reflect-metadata@0.1.2 but n
ne was installed.
npm WARN angular2@2.0.0-beta.15 requires a peer of zone.js@^0.6.10 but none was
installed.
npm WARN NEWAPP No description
npm WARN NEWAPP No repository field.
npm WARN NEWAPP No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\Users\\IBM_ADMIN\\AppData\\Roaming\\npm\\node_modules
\npm\\bin\\npm-cli.js" "install" "-a"
npm ERR! node v0.12.0
npm ERR! npm  v3.8.7
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.6.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.6.0 postinstall script 'node scripts/build.j
'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Ishank-Workarea\Projects\Whirlpool\Screenshots\NEWAPP\npm-debug
log

Thanks
Ishank

1 Like

@ishank I guess that the problem is caused by the following node-sass issue:

I would suggest you to downgrade to the latest Node v5.x.x - Node v5.11.0. Node v6.0.0 was just released and has a long list of breaking changes which might break some packages (as node-sass in this case). I guess that the upgrade to Node v6 will be safe in at least a month (or probably even 2-3 months) when the package authors manage to catch up with the breaking changes and update their packages to support Node v6.

Additionally, if you want to start a new Ionic 2 project then the correct syntax is (i.e. with --v2):

ionic start TestApp --v2

I have another issue.

ionic start myApp tutorial -v2 -ts

Error with start TypeError: options.template.indexOf is not a function
    at Object.Start.fetchSeed (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/start.js:245:25)
    at /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/start.js:105:18
    at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

PS flood question: why Ionic 2 need Q package? What about native promises or bluebird?

PPS

Cordova CLI: 6.1.1
Gulp version:  CLI version 3.9.1
Gulp local:  
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.5 
ios-sim version: 5.0.6 
OS: Mac OS X Yosemite
Node Version: v5.10.1
Xcode version: Xcode 6.4 Build version 6E35b 

@xr0master I guess that you intended to run (note that there should be 2 dashes):

ionic start myApp tutorial --v2 --ts

PS: No idea about the Q package.

2 Likes

Facepalm. Thank you.

@iignatov: I have tried with nodejs 5.11 and before installing the same I have removed npm as well as previous version of nodejs.

Still I am getting same result with the same error as below:

"Installing npm packages…
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall

C:\Ishank-Workarea\Projects\Whirlpool\Source code>cd testapp

C:\Ishank-Workarea\Projects\Whirlpool\Source code\testapp>ionic info
WARN: ionic.config.js has been deprecated, you can remove it.
Uh oh! Looks like you’re missing a module in your gulpfile:
Cannot find module ‘process-nextick-args’

Do you need to run npm install?
"

Thanks
Ishank

@ishank I’m not sure why it’s not installed properly. Could you check if there are any errors (e.g. lines starting with “npm ERR!”)? Are you starting the app with the following command: ionic start TestApp --v2 (note the 2 dashes in --v2)?

Could you run the start command with --verbose so we can see what the output from npm is? Hopefully this will give some insight as to what’s going wrong.

ionic start myapp --v2 --ts --verbose

Thanks!

EDIT: or if you prefer, delete the node_modules directory in your app and run npm install from your project root

1 Like