I'm trying to make a new project with gatsby template running the command gatsby new website-public https://github.com/gatsbyjs/gatsby-starter-default in Terminal window, but I constantly getting this error:
gatsby new website-public https://github.com/gatsbyjs/gatsby-starter-default
Error: EACCES: permission denied, open '/Users/delilah/.config/gatsby/config.json'
You don't have access to this file.
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at Ti._i.globalConfigPath.get all [as all] (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:155965)
at new Ti._i.globalConfigPath (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:155924)
at Ti (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:155721)
at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/create-gatsby/lib/index.js:1:486075)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
I have tried with following:
sudo chown -R whoami ~/.npm
sudo chown -R whoami
/usr/local/lib/node_modules
But nothing helps, I'm using Mac OSX.
If anyone has some idea, please share.
The error message says that /Users/delilah/.config/gatsby/config.json is the file you don't have access to, so that's the file you have to chown and/or chmod to fix, not paths you list as having tried.
As I don't have admin rights on my laptop, so downloaded the zip version of heroku CLI for deploying my app. When I execute the cmd from the bin path of the heroku it's launching and working fine, but when trying to launch from cygwin it's not working. Followed below workaround as I thought path issues, symlinks issues
.bash_profile
#Setting the heroku path on the cygwin
export PATH=$PATH:"/cygdrive/c/Django/heroku/bin/heroku"
export CYGWIN="winsymlinks:native"
cd C:/cygdrive && rm -rf c && ln -s -v C:/ c
.bashrc
alias heroku="/cygdrive/c/Django/heroku/bin/heroku"
which are suggested in the SO, but not helpful and I'm getting below error when trying to execute $ heroku in cygwin..
$ heroku
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module 'C:\cygdrive\c\Django\heroku\bin\run'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980
:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma
in.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Note: I'm able to launch heroku from GIT bash and CMD
whole time I was adding wrong files to the path and also executing them, Extracted zip folder of heroku contains following files
So, what I did..? copied the full path of bin including heroku.cmd file and pasted in the below file ".bashrc" as alias.
.bashrc
alias heroku="/cygdrive/c/Django/heroku/bin/heroku.cmd"
as heroku.cmd file is a script file and it contains set of commands for the heroku.
and I'm able to login to heroku and create app as well.
I'm setting up Gatsby and get stuck at the beginning.
When i write npx/npm install global gatsby-cli in the terminal -
Alems-MacBook-Pro:~ alemkahrobek$ npm install -g gatsby-cli i see this:
/usr/local/bin/gatsby -> /usr/local/lib/node_modules/gatsby-cli/lib/index.js
gatsby-telemetry#1.0.4 postinstall /usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry
node src/postinstall.js
gatsby-cli#2.5.4
added 225 packages from 131 contributors in 13.617s.
If i check the version of gatsby i get this:
Alems-MacBook-Pro:~ alemkahrobek$ gatsby -v
/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:49
throw error;
^
Error: EACCES: permission denied, open '/Users/alemkahrobek/.config/gatsby/config.json'
You don't have access to this file.
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at Configstore.get all [as all] (/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:31:25)
at new Configstore (/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:25:48)
at new Store (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/store.js:28:51)
at new EventStorage (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/event-storage.js:24:50)
at new AnalyticsTracker (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/telemetry.js:32:50)
at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/index.js:7:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10).
Now if i try to make a new project like:
gatsby new example
i get this:
Alems-MacBook-Pro:~ alemkahrobek$ npm gatsby new example
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/Users/alemkahrobek/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm#6.9.0 /usr/local/lib/node_modules/npm
Alems-MacBook-Pro:~ alemkahrobek$ npm help config
NPM-CONFIG(1) NPM-CONFIG(1)
NAME
npm-config - Manage the npm configuration files
SYNOPSIS
npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list [-l] [--json]
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]
aliases: c
DESCRIPTION
npm gets its config settings from the command line, environment vari-
ables, npmrc files, and in some cases, the package.json file.
See npm help 5 npmrc for more information about the npmrc files.
See npm help 7 npm-config for a more thorough discussion of the mechanisms involved.
The npm config command can be used to update and edit the contents of
the user and global npmrc files.
Sub-commands
Config supports the following sub-commands:
set
npm config set key value
Sets the config key to the value.
If value is omitted, then it sets it to "true".
get
npm config get key
Echo the config value to stdout.
list
npm config list
Show all the config settings. Use -l to also show defaults. Use --json
to show the settings in json format.
delete
npm config delete key
Deletes the key from all configuration files.
edit
npm config edit
Opens the config file in an editor. Use the --global flag to edit the
global config.
SEE ALSO
o npm help 5 folders
o npm help 7 config
o npm help 5 package.json
o npm help 5 npmrc
For Ubuntu users who experience the same problem, I've solved it giving the right permissions on the specified folder:
chown -R $USER:$USER /home/$USER/.config/gatsby
Check out the official page on npmjs.com: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
I would definitely the first option on that page. nvm is pretty awesome: https://github.com/creationix/nvm
I am trying to use the Atom text editor for Processing development in Windows, and am having some issues. Internet restrictions at work mean I cannot use the built-in package manager within Atom:
Fetching featured packages failed: connect ECONNREFUSED
Therefore, I need to install packages manually. I am trying to use bleikamp's Processing package for atom which allows the running of processing sketches, and have unzipped the package, downloaded from github, in the packages folder - C:\Users\my_username\.atom\packages.
The package is detected within Atom as being installed, but when I try and run a sketch, the below error occurs:
Failed to activate the processing package
Cannot find module 'ps-tree'
Error: Cannot find module 'ps-tree'
at Module._resolveFilename (module.js:455:15)
at Module._resolveFilename (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._resolveFilename (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\module-cache.js:383:52)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\native-compile-cache.js:50:27)
at Object.<anonymous> (file:///C:/Users/chris.hamilton/.atom/packages/processing-master/lib/processing.coffee:4:10)
at Object.<anonymous> (file:///C:/Users/chris.hamilton/.atom/packages/processing-master/lib/processing.coffee:1:1)
at Module._compile (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\native-compile-cache.js:109:30)
at Object.value [as .coffee] (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\compile-cache.js:216:21)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\native-compile-cache.js:50:27)
at Package.module.exports.Package.requireMainModule (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\package.js:796:27)
at Package.module.exports.Package.activateNow (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\package.js:207:16)
at C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\package.js:876:25
at Function.module.exports.Emitter.simpleDispatch (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:129:28)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\command-registry.js:240:20)
at C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\command-registry.js:3:59
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:599:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:390:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\window-event-handler.js:106:36)
at HTMLDocument.<anonymous> (C:\Users\chris.hamilton\AppData\Local\atom\app-1.14.4\resources\app.asar\src\window-event-handler.js:3:59)
I assume this is an issue with dependencies and I am probably missing a step in manually installing the package - can anyone offer any guidance? I have researched fairly extensively into manually installing packages, and there is a lot of information about using commands such as apm link and apm install, but I can't seem to access these commands.
EDIT: I have included processing-java in my PATH variable. Below is the output when path is called from cmd:
PATH=C:\Perl64\site\bin;C:\Perl64\bin;C:\ProgramData\Oracle\Java\javapath;C:\WIN
DOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPow
erShell\v1.0\;C:\Program Files (x86)\Microsoft Office\Office14\;C:\Program Files
(x86)\Enterprise Vault\EVClient\;C:\Program Files\Hummingbird\Connectivity\14.0
0\NFS Maestro\;C:\Program Files (x86)\Hummingbird\Connectivity\14.00\NFS Maestro
\;C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v713\runtime\win32;C:\WI
NDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Autodesk Sh
ared\;C:\Program Files\MATLAB\MATLAB Runtime\v90\runtime\win64;C:\Program Files\
TortoiseSVN\bin;C:\ChrisHamilton\Room_Results_Comparison\processing-3.2.1\;C:\Us
ers\chris.hamilton\AppData\Local\atom\bin
Any help would be much appreciated.
As you have guessed already, missing package dependencies are causing this error. Since you don't seem to have internet connection (or limited connection) at work, I'd recommend installing the Processing package where you are online (e.g. at home), then compress the processing folder and extract it inside the Atom packages folder at work. Make sure the processing folder includes node_modules. Optionally repeat those steps for the script package.
Dependencies are installed running apm install (or npm install) inside the package folder. Whenever an Atom package has dependencies, this step is essential. Atom (or apm) are doing this automatically.
To give you some more insights into the process, here's an alternative way to install a package with dependencies:
cd %USERPROFILE%.atom\packages
git clone https://github.com/bleikamp/processing
cd processing
npm install
It looks like you're running Windows and processing-java hasn't been added to your PATH. Try the following:
Open Advanced System Settings either by running sysdm.cpl or searching in Control Panel.
Click the Environment Variable button on the Advanced tab.
Edit the PATH variable to include the Processing directory (e.g. C:\Program Files\Processing-3.1.1\) in either the User variables (for just your account) or System variables (for all users).
Also note that bleikamp no longer maintains his Processing package and instead recommends using Script.
I am new to NodeJS. I am trying to use npm on Windows 8.
I have installed using chocolatey, cinst nodejs.install (version 0.10.17). I installed as administrator (and would prefer to run npm as a normal user).
Node itself seems to be working, I can use the REPL to run simple programs.
If I try to install something using npm, I get cannot find module:
> node npm install express
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\Klas\Documents\My Dropbox\mina egna\tech\node\webserver\npm'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
I have read the answers on Nodejs cannot find installed module on Windows? but unfortunately it is still unclear to me what I have to do.
I have tried setting NODE_PATH:
In trying to follow this answer, I have tried setting it to C:\Users\Klas\AppData\Roaming\npm\node_modules (but I had to create both the npm and the subfolder node_modules myself)
I have tried creating a folder c:\node\node_module (according to this advice, even though the installation did not even create a c:\node folder) and setting it to that.
I have tried setting it to C:\Program Files\nodejs\node_modules\npm\node_modules (which did exist after installation)
I have also tried to create a node_modules folder below the current working directory. As I understand it that is where local npm will be installed?
None of these helped. So it seems to me that setting NODE_PATH is not the solution?
Using the -g flag makes no difference (I would prefer not to use it).
I get the same error both as normal user and as administrator (I would prefer to be a normal user).
I get the same error no matter where I execute the command, except when I do it in C:\Program Files\nodejs, where I get
basedir=`dirname "$0"`
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
Not using windows, but I'm pretty sure it's just npm install express on windows too.