Ionic 2 installation issues - ionic-framework

I am trying to use Ionic 2 on Windows 7 x64 bit and got stuck when using ionic start command. I have tried to read tutorials and installation instructions but got no luck. Here's the details of my problem:
Found depreciation warnings during cordova and ionic installation:
https://postimg.org/image/vf3qn8z9b/
Then it shows errors using following command in ionic:
ionic start newProject sidemenu --v2
https://postimg.org/image/4vz80prq5/
context of my npm-debug.log:
9284 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
69285 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
69286 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: ia32
69287 verbose stack Error: node-sass#3.10.1 postinstall: `node scripts/build.js`
69287 verbose stack Exit status 1
69287 verbose stack at EventEmitter.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
69287 verbose stack at emitTwo (events.js:106:13)
69287 verbose stack at EventEmitter.emit (events.js:191:7)
69287 verbose stack at ChildProcess.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
69287 verbose stack at emitTwo (events.js:106:13)
69287 verbose stack at ChildProcess.emit (events.js:191:7)
69287 verbose stack at maybeClose (internal/child_process.js:885:16)
69287 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
69288 verbose pkgid node-sass#3.10.1
69289 verbose cwd C:\Users\Lime\newIonicProj
69290 error Windows_NT 6.1.7601
69291 error argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
69292 error node v7.3.0
69293 error npm v3.10.10
69294 error code ELIFECYCLE
69295 error node-sass#3.10.1 postinstall: `node scripts/build.js`
69295 error Exit status 1
69296 error Failed at the node-sass#3.10.1 postinstall script 'node scripts/build.js'.
69296 error Make sure you have the latest version of node.js and npm installed.
69296 error If you do, this is most likely a problem with the node-sass package,
69296 error not with npm itself.
69296 error Tell the author that this fails on your system:
69296 error node scripts/build.js
69296 error You can get information on how to open an issue for this project with:
69296 error npm bugs node-sass
69296 error Or if that isn't available, you can get their info via:
69296 error npm owner ls node-sass
69296 error There is likely additional logging output above.
69297 verbose exit [ 1, true ]
Applied Solutions:
Installed nodejs 7.3.0 (current version as of now).
Note: I have tried to install x64 bit but since I got errors, so I switched to x86 version and still no luck. I have also tried to downgrade nodejs to 6.9.2 and v4.4.7 but have made no progress at all.
Upgraded npm using "npm install -g npm", clear cache and update registry
Tried to rebuild node-sass
Tried to install minimatch, uuid and fsevents manually
Any idea, what I missed during the installation? I got same problems when creating projects using ionic version 1.

After series of uninstalling and installing the all dependencies, I found out that the problem occurred because of the incompatibility of node-sass to the current version of nodejs. I have solved the problem by:
installing x86 nodejs version 7.3.0
install cordova and ionic (not beta)
updated node-sass "install -g node-sass"
built node-sass again by using the command "npm rebuild node-sass"
After that, the when I tried to run "ionic serve" command, an error occurred. The error message was:
"Ionic serve error: Error: ENOENT: no such file or directory, open
'/home/.../IonicTest/www/index.html'"
run the command "npm run build" reference:
And cheers! It's already working :D

Yes, node 7 requires node.sass v13.12.0 or higher
69288 verbose pkgid node-sass#3.10.1
69289 verbose cwd C:\Users\Lime\newIonicProj
69290 error Windows_NT 6.1.7601
69291 error argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
69292 error node v7.3.0
Check supported versions here : https://github.com/sass/node-sass/releases?after=3.4.0-RC1

Related

Azure DevOps Pipeline NPM install task fails with node-gyp build error

I am trying to build an Azure Pipeline in Azure DevOps. The problem is that when a pipeline ran, an error occurred in an npm build task. Could it be that there are some outdated packages in package.json? Or could it be that npm is outdated?
See Step 4 in a tutorial where a pipeline started to run:
https://learn.microsoft.com/en-us/learn/modules/create-a-build-pipeline/6-create-the-pipeline
Screenshot of build tasks in a pipeline:
Raw Log:
2021-12-03T00:13:53.4119601Z ##[section]Starting: Run npm install
2021-12-03T00:13:53.4130006Z ==============================================================================
2021-12-03T00:13:53.4130664Z Task : npm
2021-12-03T00:13:53.4144256Z Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Azure Artifacts.
2021-12-03T00:13:53.4145177Z Version : 1.187.0
2021-12-03T00:13:53.4145620Z Author : Microsoft Corporation
2021-12-03T00:13:53.4146127Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/package/npm
2021-12-03T00:13:53.4146868Z ==============================================================================
2021-12-03T00:13:54.7198556Z [command]/usr/local/bin/npm --version
2021-12-03T00:13:55.4151672Z 8.1.0
2021-12-03T00:13:56.0808980Z [command]/usr/local/bin/npm config list
2021-12-03T00:13:56.3808693Z ; "env" config from environment
2021-12-03T00:13:56.3811792Z
2021-12-03T00:13:56.3813271Z userconfig = "/home/vsts/work/1/npm/13.npmrc"
2021-12-03T00:13:56.3814393Z
2021-12-03T00:13:56.3815603Z ; node bin location = /usr/local/bin/node
2021-12-03T00:13:56.3816682Z ; cwd = /home/vsts/work/1/s
2021-12-03T00:13:56.3817732Z ; HOME = /home/vsts
2021-12-03T00:13:56.3819465Z ; Run `npm config ls -l` to show all defaults.
2021-12-03T00:13:56.3822946Z [command]/usr/local/bin/npm install
2021-12-03T00:16:21.9362133Z npm WARN old lockfile
2021-12-03T00:16:21.9365129Z npm WARN old lockfile The package-lock.json file was created with an old version of npm,
2021-12-03T00:16:21.9369471Z npm WARN old lockfile so supplemental metadata must be fetched from the registry.
2021-12-03T00:16:21.9370832Z npm WARN old lockfile
2021-12-03T00:16:21.9372351Z npm WARN old lockfile This is a one-time fix-up, please be patient...
2021-12-03T00:16:21.9373414Z npm WARN old lockfile
2021-12-03T00:16:21.9375186Z npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
'''
'''
2021-12-03T00:16:22.4541247Z 2732 error | ^
2021-12-03T00:16:22.4542220Z 2732 error /home/vsts/.node-gyp/16.13.0/include/node/node.h:855:3: note: in expansion of macro ‘NODE_MODULE_X’
2021-12-03T00:16:22.4543014Z 2732 error 855 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
2021-12-03T00:16:22.4543629Z 2732 error | ^~~~~~~~~~~~~
2021-12-03T00:16:22.4544459Z 2732 error ../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
2021-12-03T00:16:22.4545125Z 2732 error 358 | NODE_MODULE(binding, RegisterModule);
2021-12-03T00:16:22.4545958Z 2732 error | ^~~~~~~~~~~
2021-12-03T00:16:22.4546611Z 2732 error make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
2021-12-03T00:16:22.4547249Z 2732 error gyp ERR! build error
2021-12-03T00:16:22.4547826Z 2732 error gyp ERR! stack Error: `make` failed with exit code: 2
2021-12-03T00:16:22.4548944Z 2732 error gyp ERR! stack at ChildProcess.onExit (/home/vsts/work/1/s/node_modules/node-gyp/lib/build.js:262:23)
2021-12-03T00:16:22.4550047Z 2732 error gyp ERR! stack at ChildProcess.emit (node:events:390:28)
2021-12-03T00:16:22.4550822Z 2732 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
2021-12-03T00:16:22.4551766Z 2732 error gyp ERR! System Linux 5.11.0-1021-azure
2021-12-03T00:16:22.4552997Z 2732 error gyp ERR! command "/usr/local/bin/node" "/home/vsts/work/1/s/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
2021-12-03T00:16:22.4554136Z 2732 error gyp ERR! cwd /home/vsts/work/1/s/node_modules/node-sass
2021-12-03T00:16:22.4554904Z 2732 error gyp ERR! node -v v16.13.0
2021-12-03T00:16:22.4555635Z 2732 error gyp ERR! node-gyp -v v3.8.0
2021-12-03T00:16:22.4556152Z 2732 error gyp ERR! not ok
2021-12-03T00:16:22.4556664Z 2732 error Build failed with error code: 1
2021-12-03T00:16:22.4557176Z 2733 verbose exit 1
2021-12-03T00:16:22.4557451Z
2021-12-03T00:16:22.4593929Z ##[error]Error: Npm failed with return code: 1
2021-12-03T00:16:22.4611672Z ##[section]Finishing: Run npm install
Why did the error occur in this task?
Microsoft updated their VMs around the 3rd December.
In this change the default node version has changed from 14.x to 16.x.
We found this exact issue when running on node 16.
This won't be a Long term fix - As you'll need to work out why your build doesn't work on Node 16, but in the short term you can add a command which tells the build agent to use version 14 of node.
Presuming you are using the modern YAML build pipelines, try adding the following as the first step in your YAML pipeline:
- task: NodeTool#0
inputs:
versionSpec: '14.x'
This should solve any node 16 issues.
If you use Classic pipelines there may be a way of including this step as it is Microsoft provided, but I'm not sure as I don't use Classic mode.
Note:
If you've run npm version 8 (which comes with node 16) it will probably have upgraded your package-lock.json file to the newer version 2 schema.
This updated package-lock.json won't work with version 14, you'll need to revert the file back to version 1 (which if you don't have an old version in source control can be done by just deleting package-lock and running npm install).
You just need to update your packagelock file with the following actions:
Update your node version from 14 to 16 by installing the 16.13.1 LTS version on the node js website: https://nodejs.org/
Update your version of npm with the command:
npm install -g npm#latest
Update your packagelock.json with the command:
npm install
Push your brand new packagelock.json file to azure then launch again your CI
=> it should be OK ^^
For Classic pipelines users, add task "Node.js tool installer" before your npm install. Node.js tool installer makes it possible to specify node version.
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/node-js?view=azure-devops

Ionic CLI V4 Looks like #ionic/v1-toolkit isn't installed in this project

After updating Ionic CLI to 4, every command I try to run does not working.
For example:
Ionic serve,
ionic cordova build android
ionic cordova run android
ionic cordova build ios
...
I receive such errors:
Looks like #ionic/v1-toolkit isn't installed in this project.
Then I try to install the package as they ask:
? Install #ionic/v1-toolkit? Yes
> npm i -D -E #ionic/v1-toolkit
But I get the following error in return:
npm WARN rsdemo.razwebs.co.il#1.1.1 No repository field.
npm WARN rsdemo.razwebs.co.il#1.1.1 No license field.
npm ERR! Cannot read property '0' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/razbuchnik/.npm/_logs/2018-08-17T05_49_32_425Z-debug.log
[ERROR] An error occurred while running subprocess npm.
npm i -D -E #ionic/v1-toolkit exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
net.js:705
throw new errors.TypeError('ERR_INVALID_ARG_TYPE',
^
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or Buffer. Received type object
at WriteStream.Socket.write (net.js:705:11)
at process.<anonymous> (/usr/local/lib/node_modules/ionic/bin/ionic:9:63)
at process.emit (events.js:159:13)
at emitPendingUnhandledRejections (internal/process/promises.js:94:22)
at runMicrotasksCallback (internal/process/next_tick.js:124:9)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
How to solve this issue?
Try to delete node_modules directory and npm i again

Probleme to install Superdesk Newsroom

I'm trying to install newsromm from https://github.com/superdesk/newsroom
with installation with NPM I've these errors :
npm WARN deprecated babel-preset-es2015#6.24.1: Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated nomnom#1.6.2: Package no longer supported. Contact support#npmjs.com for more info.
> node-sass#4.9.0 install /root/newsroom/node_modules/node-sass
> node scripts/install.js
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module '/root/newsroom/node_modules/node-sass/scripts/install.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:240:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:564:3)
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN newsroom No repository field.
npm WARN newsroom No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-07-01T18_21_45_224Z-debug.log
and with installation with YARN everything looks good :
yarn install v1.7.0
(node:40422) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "linux" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-toggle#4.0.2" has unmet peer dependency "prop-types#^15.3.0".
[4/4] Building fresh packages...
Done in 236.13s.
but when I start the app , I'v this message:
honcho start -p 5050
18:17:07 system | web.1 started (pid=52710)
18:17:07 system | websocket.1 started (pid=52711)
18:17:08 websocket.1 | /usr/bin/python: No module named superdesk
18:17:08 system | websocket.1 stopped (rc=1)
18:17:08 system | sending SIGTERM to web.v
How can I resolve this ?
Blockquote
Newsroom is just a plugin for Superdesk. You need to install Superdesk as well from https://github.com/superdesk/superdesk.

Serve error with ionic conference app

Trying to get ionic conference app (https://github.com/driftyco/ionic-conference-app) working.
ionic 2.1.13
npm version: 3.10.8
node version: 6.9.1
cordova version: 6.4.0
ionic serve -l results in the following output:
ionic-conference-app# ionic:serve C:\data\app\mkb
ionic-app-scripts serve "-l"
[13:21:16] ionic-app-scripts 0.0.44
[13:21:16] watch started ...
[13:21:16] build dev started ...
[13:21:16] clean started ...
[13:21:16] clean finished in less than 1 ms
[13:21:16] copy started ...
[13:21:16] transpile started ...
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:8100
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at Server._listen2 (net.js:1257:14)
at listen (net.js:1293:10)
at net.js:1403:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program >
Files\nodejs\node_modules\npm\bin\npm-cli.js" "r
" "ionic:serve" "--" "-l"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ionic-conference-app# ionic:serve: ionic-app-scripts serve "-l"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-conference-app# ionic:serve script 'ionic-app-
scripts serve "-l"'.
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 ionic-conference-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts serve "-l"
npm ERR! You can get information on how to open an issue for this project with:
...
There was an error serving your Ionic application: There was an error with the spawned command: serve
Any ideas as to what has gone wrong?
Many thanks
I've just tried it and it was working for me. On the package.json, it's showing that it's using the latest rc3 ("ionic-angular": "2.0.0-rc.3-201611211919") so try to do the following:
Update your ionic CLI: npm install -g ionic
Delete your node folder and do again npm install
Now, what do you get with ionic serve ?
the error you get is
listen EADDRINUSE 0.0.0.0:8100
looks like the port 8100 is in use.
try running on a different port using
--port=8101
also you can change this value in the run.js file
The error suggests to me that the port is in use already.
In my case I closed my browser instances connected to my Ionic app and also closed down my other VS Code Ionic projects and tried running the ionic serve command again and this appeared to resolve the problem.

kafka-node npm install failing on windows 7

I am new to apache kafka and trying to install their node client which is failing with the following message-
gyp ERR! stack Error: Python executable "python" is v3.4.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
There's an optional dependency called snappy that requires compilation. This dependency has been made optional since kafka-node v0.3.3 and above so you can ignore any errors generated from npm install.