fresh install of ionic fails
I just installed ionic and cordova as per the Getting Started Guide, but get the following errors on running ionic serve. Did I miss a step? Thanks for your help.
c:\mydir>npm install cordova ionic -g ... C:\mydir>ionic serve Gulp startup tasks: [ 'sass', 'watch' ] Running live reload server: http://localhost:35729 Watching : [ 'www//*', '!www/lib//*' ] Running dev server: http://localhost:8100 Ionic server commands, enter: restart or r to restart the client app from the root goto or g and a url to have the app navigate to the given url consolelogs or c to enable/disable console log output serverlogs or s to enable/disable server log output quit or q to shutdown the server and exit
ionic $ module.js:338
throw err;
^
Error: Cannot find module 'gulp-sass'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
C:\mydir>ionic info
Your system information:
Cordova CLI: 5.1.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.0.0 Ionic CLI Version: 1.6.3 Ionic App Lib Version: 0.3.7 OS: Windows 7 SP1 Node Version: v0.12.7
What happens when you run gulp sass?
Can you run npm install in the directory and see what that leads to?
You might even try npm install gulp-sass.
Thanks jbavari.
- running "gulp sass" I get the same error message as mentioned in my post above.
module.js:338
throw err;
^
Error: Cannot find module 'gulp-sass'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
(C:mydir\gulpfile.js:5:12) at Module._compile (module.js:460:26) 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 Module.require (module.js:365:17) at require (module.js:384:17) - So I ran "npm install", and the "npm install gulp-sass". This fails with the following. I do have .NET Framework 4.5.2, MS VC++ 2005 Redistributable, MS VC++ 2008 Redistributable (in various architectures) installed on my PC. But honestly I am not sure if I have all the parts it requires. (It all used to work on my PC until about last week, before I upgraded ionic, cordova and node to latest.)
C:mydir>npm install npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
[email protected] install C:mydir\node_modules\gulp-sass\node_modules\node-sass
node build.js
child_process: customFds option is deprecated, use stdio instead.
C:mydir\node_modules\gulp-sass\node_modules\node-sass>if not defined npm_config
_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" re
build ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework
2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is inst
alled elsewhere. [C:mydir\node_modules\gulp-sass\node_modules\node-sass\build
\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:
23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:mydir\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
Build failed
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "inst
all"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node build.js'.
npm ERR! 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 build.js
npm ERR! 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:mydir\npm-debug.log
C:mydir>
So, still at square one.
If it worked previously, you might be able to just downgrade by specifying npm install -g [email protected] (specify the version after the @).
We upgraded node-sass a while back, and that might fix the error you're having. Also, you might check out the issues of node-sass.
Until we resolve this, I'd love some help figuring out how to work through this so our other users do not run into that.
My apologies if this sounds very ignorant, but how do I use node-sass instead of gulp-sass?
I installed an older version of [email protected]. Works OK.
@dineshgh No worries. We are all ignorant until we learn. node-sass is used by gulp-sass, gulp-sass is just simply the gulp task that wraps it up.
Glad to hear you're back to working.