"It is likely you do not have the permissions" when trying to launch the development server for WebAssembly + Vite + Vue - vue.js

When I run yarn dev I get the following output:
yarn run v1.22.10
warning package.json: No license field
$ vite
🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀
⚡️⚡️ Hello RSW! ⚡️⚡️
⚡️⚡️ Vite + Rust 💖 WebAssembly ⚡️⚡️
🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀
vite-plugin-rsw (1.8.0)
[rsw::deploy] https://github.com/lencx/rsw-node
[rsw::optimized] wasm-pack build wasm.
up to date, audited 241 packages in 3s
7 packages are looking for funding
run `npm fund` for details
4 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../../../home/isaachmi/projects/my-blackspace/wasm/pkg
npm ERR! dest /usr/lib/node_modules/wasm
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../../../home/isaachmi/projects/my-blackspace/wasm/pkg' -> '/usr/lib/node_modules/wasm'
npm ERR! [Error: EACCES: permission denied, symlink '../../../home/isaachmi/projects/my-blackspace/wasm/pkg' -> '/usr/lib/node_modules/wasm'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../../../home/isaachmi/projects/my-blackspace/wasm/pkg',
npm ERR! dest: '/usr/lib/node_modules/wasm'
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! /home/isaachmi/.npm/_logs/2021-07-21T14_44_01_966Z-debug.log
[rsw::npm::link]
↳ wasm /home/isaachmi/projects/my-blackspace/wasm/pkg
error when starting dev server:
Error: The following dependencies are imported but could not be resolved:
wasm (imported by /home/isaachmi/projects/my-blackspace/src/components/HelloWorld.vue)
Are they installed?
at optimizeDeps (/home/isaachmi/projects/my-blackspace/node_modules/vite/dist/node/chunks/dep-f2b4ca46.js:73091:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOptimize (/home/isaachmi/projects/my-blackspace/node_modules/vite/dist/node/chunks/dep-f2b4ca46.js:73765:48)
at async Server.httpServer.listen (/home/isaachmi/projects/my-blackspace/node_modules/vite/dist/node/chunks/dep-f2b4ca46.js:73779:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
My WebAssembly package is called wasm and this is my vite configuration:
import { defineConfig } from "vite";
import vue from "#vitejs/plugin-vue";
import ViteRsw from "vite-plugin-rsw";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
ViteRsw({
crates: ["wasm"],
}),
],
});
I'm using a plugin for vite to use Rust and WebAssembly. I followed the example that they have with Vue3 but using my package. Am I doing something wrong?

Related

I couldn't install import sass into my project

when I run the command
npm install --save-dev sass
from bootstrap-v5 folder I'm getting this error shown below
npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path ../sass/sass.js
npm ERR! dest/storage/emulated/0/Android/data/io.spck/files/New_Portfolio_project/bootstrap-v5/node_modules/.bin/sass
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, symlink '../sass/sass.js' -> '/storage/emulated/0/Android/data/io.spck/files/New_Portfolio_project/bootstrap-v5/node_modules/.bin/sass'
npm ERR! [Error: EPERM: operation not permitted, symlink '../sass/sass.js' -> '/storage/emulated/0/Android/data/io.spck/files/New_Portfolio_project/bootstrap-v5/node_modules/.bin/sass'] {
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '../sass/sass.js',
npm ERR! dest: '/storage/emulated/0/Android/data/io.spck/files/New_Portfolio_project/bootstrap-v5/node_modules/.bin/sass'
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! /data/data/com.termux/files/home/.npm/_logs/2021-09-29T17_41_24_947Z-debug.log
But I was able to install sass globally with the command npm i -g sass.
I'm just trying this out for the first time. And, is there any way to import sass to my project as I have already installed sass globally?
Try npm install node-sass instead of npm install sass

npm start isn't working, react-native app

im trying to build react-native app.
running the commands on gitBash, windows10.
when im trying to run 'npm start' im getting this error:
Fixed , just installed again expo-cli in the rn-starter folder, thanks for the answers :)
$ npm start
> # start C:\Users\Liran\food
> expo start
'expo-cli' is not recognized as an internal or external command,
operable program or batch file.
This command requires Expo CLI.
Do you want to install it globally [Y/n]? Y
Installing the package 'expo-cli'...
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll',
npm ERR! parent: 'expo-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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! C:\Users\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_255Z-debug.log
Installing Expo CLI failed. You can install it manually with:
npm install --global expo-cli
npm ERR! code ELIFECYCLE
npm ERR! errno 4294963248
npm ERR! # start: `expo start`
npm ERR! Exit status 4294963248
npm ERR!
npm ERR! Failed at the # start 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! C:\Users\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_348Z-debug.log
help please someone :)
Open windows terminal as Administrator and run command:
install --global expo-cli
then from the root of your project you can either run expo start or npm start both will do.
You need to install Expo CLI package.
see: https://docs.expo.io/workflow/expo-cli/
install:
npm install -g expo-cli
If you still getting same error do these two steps;
Be sure about working on terminal as administrator
If you're using an antivirus program, STOP it while trying to execute above command.

How to install expo cli correctly?

I am trying to install expo cli globally but I am getting errors:
OS: Catalina 10.15.4
Node: 14.6
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
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/mac/.npm/_logs/2020-07-25T10_36_46_119Z-debug.log
I install in the Visual Studio terminal, I also tried to install through the console, but the result did not change
When installing some packages globally, you need to do so as a privileged user. On Mac, use sudo to elevate the installation command. E.g. sudo npm install your-package -g

How to install Yoeman on Ubuntu18.04

I am installing Yeoman on my machine and ran this
npm install -g yo
This is giving me permission error:
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'] {
npm ERR! stack: "Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'
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! /home/siddharth/.npm/_logs/2020-04-24T22_31_29_025Z-debug.log
But this got resolved by attaching sudo
Now I am getting this error:
Yeoman Doctor
Running sanity checks on your system
✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
path: 'yo',
spawnargs: [ '--version' ],
cmd: 'yo --version'
}
✖ yo version
Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
path: 'yo',
spawnargs: [ '--version' ],
cmd: 'yo --version'
}
Found potential issues on your machine :(
+ yo#3.1.1
updated 1 package in 29.492s
Running yo --version is giving zsh: command not found: yo
I tried this https://stackoverflow.com/a/58277450/10309895 but this is also not working for me
:,(

Error when installing the express application generator

I recently installed node and express with the help of the mozilla tutorial. I am on the next step of installing the application generator, but when I run
npm install express-generator -g
in my terminal: I recieve the following errors:
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adamgusky/.npm/_logs/2018-02-17T20_26_53_688Z-debug.log
I've been googling this topic for an hour now and I am very new to using the terminal for web applications (this is for a school project), so any help is appreciated.
I had a similar issue. The problem is that you aren't an administrator so you can't write to that folder. However it's considered a BAD IDEA to run sudo npm install. So what you need to do is to change the default install folder for npm global installation to one where you do have write permission.
See npm's documentation: https://docs.npmjs.com/getting-started/fixing-npm-permissions.
And also see this useful article on github: https://github.com/nodeschool/discussions/wiki/Installing-global-node-modules-(Linux-and-Mac)