Node-Red I can't install nodes - raspberry-pi3

I have something wrong with Node-red. After installing library nothing appears in Node-red. I was trying to find this issue on the internet for several hours but nothing help.
I guess problem is with directory...
Could you help me please?
Thanks
Here you can see install log of NPMJS and Library:
pi#raspberrypi:~ $ curl https://www.npmjs.com/install.sh | sudo sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5450 100 5450 0 0 22708 0 --:--:-- --:--:-- --:--:-- 22803
tar=/bin/tar
version:
tar (GNU tar) 1.30
Copyright © 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Napsali John Gilmore a Jay Fenlason.
install npm#latest
fetching: https://registry.npmjs.org/npm/-/npm-6.14.6.tgz
up to date in 0.334s
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ npm#6.14.6
added 435 packages from 877 contributors in 54.249s
It worked
pi#raspberrypi:~ $ npm install node-red-contrib-opcua
npm WARN checkPermissions Missing write access to /home/pi/node_modules/node-red-contrib-opcua
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /home/pi/node_modules/node-red-contrib-opcua
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/home/pi/node_modules/node-red-contrib-opcua'
npm ERR! { [Error: EACCES: permission denied, access '/home/pi/node_modules/node-red-contrib-opcua']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/home/pi/node_modules/node-red-contrib-opcua\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/home/pi/node_modules/node-red-contrib-opcua' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2020-07-09T09_31_09_039Z-debug.log
pi#raspberrypi:~ $ sudo npm install node-red-contrib-opcua
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
+ node-red-contrib-opcua#0.2.66
updated 1 package and audited 649 packages in 24.45s
24 packages are looking for funding
run `npm fund` for details
found 89 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
pi#raspberrypi:~ $
Log of reccomeded commands:
pi#raspberrypi:~ $ npm fund
/home/pi
├─┬ https://opencollective.com/node-red-contrib-modbus
│ └── node-red-contrib-modbus#5.13.3
├─┬ https://github.com/sponsors/sindresorhus
│ └── mimic-response#2.1.0, p-limit#2.3.0
├─┬ https://github.com/sponsors/feross
│ └── safe-buffer#5.2.1
├─┬ https://www.patreon.com/feross
│ └── safe-buffer#5.2.1
├─┬ https://feross.org/support
│ └── safe-buffer#5.2.1
├─┬ https://github.com/sponsors/erossignon
│ └── node-opcua#2.7.0
├─┬ https://github.com/chalk/chalk?sponsor=1
│ └── chalk#4.1.0
├─┬ https://github.com/chalk/ansi-styles?sponsor=1
│ └── ansi-styles#4.2.1
├─┬ https://github.com/sponsors/isaacs
│ └── rimraf#3.0.2, glob#7.1.6
├─┬ https://github.com/sponsors/jonschlinkert
│ └── picomatch#2.2.2
├─┬ https://opencollective.com/core-js
│ └── core-js-pure#3.6.5
└─┬ https://github.com/sponsors/ljharb
└── deep-equal#1.1.1, is-date-object#1.0.2, is-regex#1.1.0, object-is#1.1.2, regexp.prototype.flags#1.3.0, has-symbols#1.0.1, es-abstract#1.17.6, es-to-primitive#1.2.1, is-callable#1.2.0, object-inspect#1.8.0, string.prototype.trimend#1.0.1, string.prototype.trimstart#1.0.1, is-symbol#1.0.3
pi#raspberrypi:~ $ npm audit fix
npm ERR! code EAUDITNOPJSON
npm ERR! audit No package.json found: Cannot audit a project without a package.json
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2020-07-09T09_56_29_012Z-debug.log

First, you are trying to install nodes in the wrong directory. To install Node-RED nodes you need to be in the userDIR (this is logged at startup, but is normally /home/pi/.node-red on a Raspberry Pi)
Second the permission error implies that you have tried to run npm as root at some point. You should not be using sudo to run npm normally.

Related

Updating Corepack in Apple won't yield the proper result

I am trying to update my system fully (CorePack, npm, Jest...)
Runnign npm list -g yields
/usr/local/lib
├── corepack#0.15.2
├── jest#29.3.1
├── n#9.0.1
└── npm#9.3.1
Today (Jan 19th 2023), CorePack latest version is 0.15.3, to which I was trying to update from 0.15.2.
Runnning npm install -g corepack, the output of my terminal is as it follows:
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/corepack
npm ERR! dest /usr/local/lib/node_modules/.corepack-xqcTrkeV
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/corepack' -> '/usr/local/lib/node_modules/.corepack-xqcTrkeV'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/corepack' -> '/usr/local/lib/node_modules/.corepack-xqcTrkeV'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/corepack',
npm ERR! dest: '/usr/local/lib/node_modules/.corepack-xqcTrkeV'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/AGLAYA/.npm/_logs/2023-01-19T14_19_40_038Z-debug-0.log
As far as I know, I should have all possible permissions, as I am the only Administrator User who uses my computer—and never before had any permissions issues.
Obviously, I would've expected CorePack to get updated to 0.15.3.
Also, what is n#9.0.1?

How to install Vuetify with Laravel8 Vue3 app

I am currently creating a Todo app in Laravel 8 + Vue3.
I have attempted to install Vuetify to get the design right, but it does not work.
According to my research, Vuetify is not supported in Vue3, is it not available in vue3?
The following is the error log.
PS C:\Users\shozo\Documents\programming\laravel-todolist\todolist\todolist_app> npm install vuetify
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: vue#3.2.45
npm ERR! node_modules/vue
npm ERR! vue#"^3.2.31" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue#"^2.6.4" from vuetify#2.6.12
npm ERR! node_modules/vuetify
npm ERR! vuetify#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\shozo\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shozo\AppData\Local\npm-cache\_logs\2022-11-20T12_39_49_817Z-debug-0.log
Here is my development environment
Laravel Framework 8.83.8
todolist_app# C:\Users\shozo\Documents\programming\laravel-todolist\todolist\todolist_app
├─┬ #fortawesome/vue-fontawesome#3.0.0-5
│ └── vue#3.2.31 deduped
└─┬ vue#3.2.31
└─┬ #vue/server-renderer#3.2.31
└── vue#3.2.31 deduped
PHP 8.1.2 (cli) (built: Jan 19 2022 10:18:23) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
PS C:\Users\shozo\Documents\programming\laravel-todolist\todolist\todolist_app> npm -v
8.5.0
I want to use vuetify in my current project
If I can't, I will re-create it with vue version 2.
Vuetify has very recently released v3.0.0 which does support VueJS 3.
In order to install the very latest version of Vuetify 3 from npm, use the package found under #vuetify/nightly. At the time of writing this latest nightly version can be installed using the following command:
npm i #vuetify/nightly#3.0.2
You can check other versions of the package here.

Adding a package immediately after created by create-react-app is not working

I am very new to react (started a day ago). I used the create-react-app command line to create an app. I tried in the following order
create-react-app my-app
npm start
At this point the app is running fine. Then I did the following
npm install youtube-api-search
npm start
Now i am getting this error
my-app#0.1.0 start /Users/shanmugharajk/Code/udemy/my-app
react-scripts start
sh: react-scripts: command not found npm ERR! file sh npm ERR! code
ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR!
my-app#0.1.0 start: react-scripts start npm ERR! spawn ENOENT npm
ERR! npm ERR! Failed at the my-app#0.1.0 start script. npm ERR! This
is probably not a problem with npm. There is likely additional logging
output above.
This happens every single time with any package I try to install.
One think I noted is when i run
npm install youtube-api-search or any pckage it always removes some package. The message I am getting while installing any package is
npm WARN registry Using stale data from https://registry.npmjs.org/
because the host is inaccessible -- are you offline? npm WARN registry
Unexpected warning for https://registry.npmjs.org/: Miscellaneous
Warning ENOTFOUND: request to https://registry.npmjs.org/redux failed,
reason: getaddrinfo ENOTFOUND registry.npmjs.org
registry.npmjs.org:443 npm WARN registry Using stale package data from
https://registry.npmjs.org/ due to a request error during
revalidation. npm WARN gentlyRm not removing
/Users/shanmugharajk/Code/udemy/my-app/node_modules/html-minifier/node_modules/.bin/uglifyjs
as it wasn't installed by
/Users/shanmugharajk/Code/udemy/my-app/node_modules/html-minifier/node_modules/uglify-js
npm WARN gentlyRm not removing
/Users/shanmugharajk/Code/udemy/my-app/node_modules/espree/node_modules/.bin/acorn
as it wasn't installed by
/Users/shanmugharajk/Code/udemy/my-app/node_modules/espree/node_modules/acorn
npm WARN gentlyRm not removing
/Users/shanmugharajk/Code/udemy/my-app/node_modules/autoprefixer/node_modules/.bin/browserslist
as it wasn't installed by
/Users/shanmugharajk/Code/udemy/my-app/node_modules/autoprefixer/node_modules/browserslist
npm notice created a lockfile as package-lock.json. You should commit
this file.
redux#3.7.1 added 3 packages, removed 1142 packages and updated 3 packages in 27.043s
I couldn't figure out the reason. Please help me.
You are using npm 5. At the moment it has many issues.
I recommend to downgrade to npm 4 and try again:
npm install -g npm#4
rm -rf node_modules
rm package-lock.json
npm install
If it doesn't help check your internet connection.
This looks like an issue with your network:
getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
I got the answer, since I had yarn and npm both installed in my machine the create-react-app uses yarn and installs all the dependencies and creates yarn.lock file.
So now when I run npm install it looks for package.lock.json and it wont be there. So it uninstalls some package creates by yarn at the time of creation of the project.
So the solution I found is do any of the following
create-react-app my-app
npm install
Then do install npm install -package-
Or
create-react-app my-app
yarn install -package-
Both of this approach is working now for me.
Basic requirement to run React app is:
nodejs
npm
If it is not installed then install this by(specifically for Ubuntu)
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
To create react js app:
npx create-react-app my-DemoApp
A
fter that go inside folder by:
cd my-DemoApp
You can see basic folder structure created by this
my-DemoApp
├── README.md
├── package.json
├── .gitignore
├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
└── src
├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.svg
└── serviceWorker.js
After than add basic dependency required by react app by running:
npm install
That will create new folder named : node_modules in your parent folder
You can now run your app by :
npm start
And now you are done with most basic setup, you're app is now ready.
You also can add more library which is mandatory for the app by npm
npm install -g npm
And then install create react app again:
npm install -g create-react-app
And then create the project again

Getting the following error when trying to install anything with npm

Whenever I try to install packages I get this error:
/usr/local/bin/karma -> /usr/local/lib/node_modules/karma/bin/karma
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "karma"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package karma does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-karma#0.6.2 wants karma#~0.10.0
npm ERR! peerinvalid Peer karma-html2js-preprocessor#0.1.0 wants karma#>=0.9
npm ERR! peerinvalid Peer karma-mocha#0.1.10 wants karma#>=0.12.8
npm ERR! peerinvalid Peer karma-phantomjs-launcher#0.1.4 wants karma#>=0.9
npm ERR! peerinvalid Peer karma-script-launcher#0.1.0 wants karma#>=0.9
npm ERR! peerinvalid Peer karma-jasmine#0.1.6 wants karma#>=0.9
npm ERR! peerinvalid Peer karma-requirejs#0.2.2 wants karma#>=0.9
npm ERR! peerinvalid Peer karma-coffee-preprocessor#0.1.3 wants karma#>=0.9
npm ERR! Please include the following file with any support request:
npm ERR! /Applications/Xcode-beta.app/Contents/Developer/npm-debug.log
I've tried uninstalling/reinstalling npm, node and karma but to no avail
also tried:
rm -rf /usr/local/lib/node_modles/karma-*
npm cache clean -g
I had the same error for generator-karma and here's what I did:
Run this:
[sudo] npm -g ls --depth=0
It'll show you the list of modules, like this:
├── bower#1.5.2
├── david#6.2.0
├── express#4.13.3
├── express-generator#4.13.1
├── generator-karma#1.0.0 peer invalid
├── grunt#0.4.5
├── grunt-cli#0.1.13
├── gulp#3.9.0
├── ionic#1.6.4
├── jscs#2.1.1
├── jshint#2.8.0
├── less#2.5.1
├── mean-cli#0.10.14
├── mocha#2.3.0
├── node-inspector#0.12.3
├── nodemon#1.4.1
├── nodesql#0.2.4
├── npm#2.11.3
├── pm2#0.14.7
├── sass#0.5.0
├── sqlite3#3.0.10
├── todo#1.1.0
└── yo#1.4.7
See this line: generator-karma#1.0.0 peer invalid ?
This is the problematic one, you should see something similar in your output. You can either try to update it with [sudo] npm -g update generator-karma or remove it with [sudo] npm -g uninstall generator-karma and do what you wanted to do in the first place.
After that, re-installing it again or leaving it like this is up to you.

npm package errors after new instalation of node.js on windows 7

I have problems instaling some packages with npm, after uninstalling node.js from C:\nodejs and installing in Program Files\nodejs
I previously removed folders npm cache and npm from appdata folder.
I am using latest official node version from their site.
I also tried with chocolatey package nodejs.install...
this is uotput from console:
C:\Users\My\Desktop>npm install -g gulp
npm ERR! Error: UNKNOWN, open 'C:\Users\My\AppData\Roaming\npm-cache\minimatch\0.3.0\package\package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "gulp"
npm ERR! cwd C:\Users\My\Desktop
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path C:\Users\My\AppData\Roaming\npm-cache\minimatch\0.3.0\package\package.json
npm ERR! code UNKNOWN
npm ERR! errno -1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\My\Desktop\npm-debug.log
npm ERR! not ok code 0
C:\Users\My\Desktop>
after trying to install gulp I successfully installed grunt
C:\Users\My\Desktop>npm install -g grunt
grunt#0.4.5 C:\Users\My\AppData\Roaming\npm\node_modules\grunt
├── dateformat#1.0.2-1.2.3
├── which#1.0.5
├── eventemitter2#0.4.13
├── getobject#0.1.0
├── colors#0.6.2
├── rimraf#2.2.8
├── async#0.1.22
├── hooker#0.2.3
├── grunt-legacy-util#0.2.0
├── exit#0.1.2
├── lodash#0.9.2
├── coffee-script#1.3.3
├── iconv-lite#0.2.11
├── underscore.string#2.2.1
├── minimatch#0.2.14 (sigmund#1.0.0, lru-cache#2.5.0)
├── glob#3.1.21 (inherits#1.0.0, graceful-fs#1.2.3)
├── findup-sync#0.1.3 (lodash#2.4.1, glob#3.2.11)
├── nopt#1.0.10 (abbrev#1.0.5)
├── grunt-legacy-log#0.1.1 (lodash#2.4.1, underscore.string#2.3.3)
└── js-yaml#2.0.5 (esprima#1.0.4, argparse#0.1.15)
C:\Users\My\Desktop>
Do you try this?:
npm cache clear
I solve a similar issue with this command.

Resources