Can't create new apps or start older ones

I didn’t use ionic for a couple of weeks, now that I came back on my project nothing seem to work.

When I run ionic serve on a project folder, i get a lot of errors, and the same happens when i try to ionic start name type

This is for example the few first lines on ionic start

× Running command - failed!
[ERROR] An error occurred while running npm install (exit code 1):

        npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys

        > node-sass@4.5.3 install C:\Users\Leonardo\Documents\Ionic\Marcello\node_modules\node-sass
        > node scripts/install.js

        Cached binary found at C:\Users\Leonardo\AppData\Roaming\npm-cache\node-sass\4.5.3\win32-x64-57_binding.node

        > uglifyjs-webpack-plugin@0.4.6 postinstall
        C:\Users\Leonardo\Documents\Ionic\Marcello\node_modules\uglifyjs-webpack-plugin
        > node lib/post_install.js


        > node-sass@4.5.3 postinstall C:\Users\Leonardo\Documents\Ionic\Marcello\node_modules\node-sass
        > node scripts/build.js

        Binary found at
        C:\Users\Leonardo\Documents\Ionic\Marcello\node_modules\node-sass\vendor\win32-x64-57\binding.node
        Testing binary
        Binary has a problem: Error: %1 non è un'applicazione di Win32 valida.
        \\?\C:\Users\Leonardo\Documents\Ionic\Marcello\node_modules\node-sass\vendor\win32-x64-57\binding.node
        at Object.Module._extensions..node (module.js:598:18)

Any idea?

Delete that file.

What does that mean in English?

Binary has a problem: Error: %1 is not a Win32 valid application.

%1 non è un’applicazione di Win32 valida = %1 is not a valid win32 application

Ok, the cached binary is broken somehow. Try to get rid of it.

I tried to unistall and reinstall everything, still have this issue.

I tried to install node.js and ionic on a new computer, exact same issue. A friend installed it on his computer, same procedure, and everything is working… it doesn’t make any sense to me.

How? Sorry but it’s about 5 hours that I’m on this issue and I’m running out of ideas :frowning:

These are the last line from npm-debug.log

84952 error Windows_NT 10.0.15063
84953 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
84954 error node v6.11.2
84955 error npm  v3.10.10
84956 error code ELIFECYCLE
84957 error node-sass@4.5.3 postinstall: `node scripts/build.js`
84957 error Exit status 1
84958 error Failed at the node-sass@4.5.3 postinstall script 'node scripts/build.js'.
84958 error Make sure you have the latest version of node.js and npm installed.
84958 error If you do, this is most likely a problem with the node-sass package,
84958 error not with npm itself.
84958 error Tell the author that this fails on your system:
84958 error     node scripts/build.js
84958 error You can get information on how to open an issue for this project with:
84958 error     npm bugs node-sass
84958 error Or if that isn't available, you can get their info via:
84958 error     npm owner ls node-sass
84958 error There is likely additional logging output above.
84959 verbose exit [ 1, true ]

Do you get this line with the first install as well?

To me it seems something is messing with this download (virus scanner? firewall? vpn? trojan? virus?) and then it is broken inside the cache, so exach subsequent install will use this and also fail.

The only antivirus is the basic W10 guardian, I will try to unistall everything and install them back with it turned off…

UPDATE: Didn’t work

It is enough to find this file, look at it, compare it with the version on Github, delete it and try to install again. No need to delete everything. On the first install it should show where it gets this file from.

Thank you for your help… but we’re still stuck.

I replaced the file win32-x64-57_binding.node with the one taken from here https://github.com/sass/node-sass/releases

still the same errors on ionic start

What does it output if there is no such cached file?
Can you create a situation where there it has to download the file itself?

(There might be a command to ionic start without npm install. If you use that, you could simplify your testing by having a “valid” Ionci project and only have to run npm install and delete node_install to iterate)

I tried with my laptop to do the exact same procedure (install node, cordova and ionic) with a friend’s wifi, and everything worked.

Came back to my home, under my wifi, and the laptop still works perfectly (can create new projects, compile and serve)

May be something related to my network? Considering that the same laptop under my wifi didn’t work.

See my earlier post:

Firewall disabled and no virus found.

About the cache, after all those installations I lost track of what and where gets installed everytime. Is there anything that usually need some manual delete?

No, usually not.

In general everything from npm gets installed in node_modules. If you delete that one and run npm install you should get everything new again.

As far as I understand, it’s a kind of virus, maybe even a cryptographer (ransomware).

In this case, I recommend this resource http://myspybot.com/arena-ransomware/, it has a lot of useful information.