Nativescript-cli: Could not update the project! Reason is: Command npm.cmd failed with exit code 1

Created on 12 Nov 2020  路  6Comments  路  Source: NativeScript/nativescript-cli

I updating nativescript latest version handmade but when run command tns update have errors appears
Pls comment below if you have any solution

image
Thanks !

bug

Most helpful comment

@rigor789 I was trying to update listview when I ran into that issue. Thanks to you mentioning 'ns migrate'. I was able to work around that 'command npm failed' issue by first migrating the listview project. Here is what I did:

git reset --hard (from root of nativescript-ui-samples-angular)
git clean -dfx
cd listview
ns migrate
npm install
ns update
(This time I don't get the 'Command npm failed with exit code 1' error.)

Hope this helps anyone troubleshooting. Thanks
sr3dna

All 6 comments

you should post your package.json

I encountered the same issue. All I did was clone this sample: https://github.com/ProgressNS/nativescript-ui-samples-angular.git. Then run 'tns update'

Image

I got 'No issues were detected' when I run 'tns doctor'.

My environment:

nativescript: 7.0.11
npm: 6.14.8
@angular/cli: 10.1.2
javac: 1.8.0_191
node: 10.17.0

@devcodedao Please post the contents of the package.json

@sr3dna which folder did you ran into that? I tried in charts and it required a migration, and then I tried in listview which seems to have a similar issue. By using yarn, it printed a more helpful message:

Could not update the project! Reason is: No matching version found for tns-ios@null.

This is likely a bug in the CLI, just helpful if you can confirm you are seeing the same thing!

@rigor789 I was trying to update listview when I ran into that issue. Thanks to you mentioning 'ns migrate'. I was able to work around that 'command npm failed' issue by first migrating the listview project. Here is what I did:

git reset --hard (from root of nativescript-ui-samples-angular)
git clean -dfx
cd listview
ns migrate
npm install
ns update
(This time I don't get the 'Command npm failed with exit code 1' error.)

Hope this helps anyone troubleshooting. Thanks
sr3dna

Hi,
I still have this error could anyone help me?
I'm trying to migrate the project with nativescript 6.8.0 to 7, I have globally installed nativescrit 7.0.11.

@FZampetti you can install nativescript@next to include this fix - have a few things lined up for the release, so it hasn't been published yet.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZMW9 picture ZMW9  路  3Comments

NickIliev picture NickIliev  路  3Comments

Anilinfo2015 picture Anilinfo2015  路  3Comments

bradmartin picture bradmartin  路  3Comments

Fatme picture Fatme  路  3Comments