Error when building brunch with banana pancakes - node.js

I created a brunch project with the banana pancakes skeleton
brunch new brunchtest -s github://Anaphase/brunch-banana-pancakes
Then when building I get an error
cd brunchtest
brunch build
-> error: { [Error: Cannot find module '/media/sf_C_DRIVE/wamp/www/test/brunchtest/node_modules/clean-css-brunch'] code: 'MODULE_NOT_FOUND' }
So its obvious that some modules are missing but why? The strange part is that when I create the project I see that these modules are downloaded and put into node_modules but then they are removed during the creation process and only these remain:
Here's the whole npm-debug.log file, I see there are some errors but I don't know what they mean
http://pastebin.com/E4eMFeiC
Update
Here's a screenshot of the installation process errors (which should be in the logfile but I guess this is more convenient)

As per MrAzulay's comment, there's a security setting in Virtualbox that disables symlinking. He says he's had success with the following command, which I haven't tested:
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate 1

Related

Can't create a react native empty project, app.json not found

I am currently trying to get started with react native.
I set up the development environment referring to the documentation, but can't even pass the first step and create an empty project.
I am on Windows 11, Node 16.15.1, and NPM 8.12.2
I keep getting the following error when trying to init react-ative project with expo init awesomeProject
Error downloading and extracting template package: Error: npm exited with non-zero code: 1
× Something went wrong while downloading and extracting the template.
Can't read JSON file: D:\crna\awesomeProject\app.json
└─ Cause: Error: ENOENT: no such file or directory, open 'D:\crna\awesomeProject\app.json'
Does anyone has a suggestion ?
Don't really know what is the problem but i found a soluion that might help other people in the same situation as me! like said here just run in CMD instead of GitBash
Use sudo if on linux. And maybe Admin on windows.

Node.js node:internal/modules/cjs/loader:936 error while trying to use discord.js

I'm trying to make a discord bot with the command prefix "*" but when I try to get the bot online/run it, it gives me this error:
node:internal/modules/cjs/loader:936
node:internal/modules/cjs/loader:936 throw err; ^
Error: Cannot find module 'C:\Users\name\const'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
The module I'm using is discord.js and i've installed discord.js on CMD and the VSC terminal but it still comes up with the MODULE NOT FOUND error. I've looked around the internet and I can't find one that fixes the problem. I've tried reinstalling Node.js but it won't stop coming back. Please help, Thanks!
same error with me but I just change file dir cause I run node <filename.js> in the wrong dir so I just change like ---
the first step chacks you are in the right dir or not type: > ls
then if you are in the right dir then type: node <filename.js> if not then change your dir to change dir type: cd <filename>
and then run your first app or file for run type: node <filename.js>
I hope your error is solved!
you need to run it as an administrator so sudo(whatever you tryna run) as long as you are in the right directory
On Windows I solved it like this.
I went to the folder: C:\Users\Documents\AppData\Roaming\npm
And I deleted the file. create-react-app.
I started the project again, and it worked.
root cause, my path was messed up, but I only figured that out once I found where my npm packages where. I had thought they were in ../Programs/Roaming/npm etc but since an update (I think to node) my packages were actually in a Python Lib subdir.
Your Answer might be the same as mine, and I found out all this by using the
npm list -g
Command - which showed the globally installed packages, but also highlighted that this was nowhere to be found in my path
Hope this helps someone!
I had the same error and it was a case of trying to run the file in node from the wrong location.
My solution was to use the terminal and CD into the exact folder the file I was trying to run were and then after that I could run node filename.js.
In my case (this error ocurred at running docker container of next app), it was because I was running docker-compose without the flag --build, but of without copy lock files (package-lock.json and/or yarn.lock).
I updated my Dockerfile:
[...]
COPY yarn.lock .
RUN yarn install --frozen-lockfile
CMD [ "yarn", "dev" ]
And after, run with docker-compose up --build
When I was following a JS tutorial i got this error message too.
The problem was I copied an existing JS file and renamed it but it
through that error when i ran it.
When i created a new JS file, and copied the code in, and ran, it worked.
Before starting your server you need to make sure that the start file is mentioned below
cross-env NODE_ENV=production node index<start file name eg:index for index.js>
It happens when you run npm run start without getting into the project first... So, before starting to compile your project, run this command: cd <project folder name>...
It will stop showing the "Missing Module" Error and smoothly run your desired output in your browser
When was trying to find 'npm' & 'Rdme' path from command prompt to update the Rdme was getting this error Log
This error is caused when file can't be found or its a wrong path, In my case I added the missing file to respective folders- configured & updated in Environment variables (after adding missing files)
For the coming next. For me I'v got the error when I tried to run a package.json script with the npx run rather npm run.
In my case, I used chocolatey to install nodejs and it fixed my issue.
Open an Administrator Command Prompt (right click Command Prompt and select "Run as Administrator"), then run the following command:
choco install -y nodejs-lts
I hope it works for you too :)
The error tells that you've required packages that you haven't installed. So please make sure that you've installed every package that you've required in your bot. Also if you're sure that you've installed it, please check it again, there were namely some problems for some people that some of their packages got uninstalled while updating Discord.js to version 13.
For your problem in the comments ("TypeError [CLIENT_MISSING_INTENTS]"), it is now required in Discord.js version 13 to add your needed intents in the client. Please read this part of the Discord.js guide.
I fixed this issue by changing the opened directory of the terminal. Just go to the terminal and type: cd <folder name> until you reach the folder in which your js file is located. Then save and run again.
npm uninstall webpack-cli -D
npm install webpack-cli#3.3.12 --save-dev
than work fine

React-Native Packager Failure: Duplicate module name

This happened seemingly randomly during development. When trying to run npm start or react-native run-ios, I get the following error:
Failed to build DependencyGraph: #providesModule naming collision:
Duplicate module name: react-native-vector-icons
Paths: /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/local-cli/rnpm/core/test/fixtures/files/package.json collides with /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by a #providesModule declaration with the same name accross two different files.
Error: #providesModule naming collision:
Duplicate module name: react-native-vector-icons
Paths: /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/local-cli/rnpm/core/test/fixtures/files/package.json collides with /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by a #providesModule declaration with the same name accross two different files.
at HasteMap._updateHasteMap (/Users/chandlervdw/Repos/Relay/mobile/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:162:15)
at /Users/chandlervdw/Repos/Relay/mobile/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:140:25
Strangely, /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/local-cli/rnpm/core/test/fixtures/files/package.json actually does list react-native-vector-icons as the name for the module???
If I delete that file, the error no longer happens but the packager gets stuck at 93% and complains about a completely irrelevent library not being found.
I blew away my repo and even reinstalled everything, including npm, rnpm, and even upgrading node. I'm running the same versions of everything as my teammates, who are able to run the packager without issues.
Posting this as an answer just in case anybody else has this issue in future.
Running npm start with sudo permissions grants the correct privileges when nodes package manager is running the initial build phase. This only seems to happen if the shell/user that you are running from has restricted privileges. Force escalating privileges to sudo gives the package manager full control to complete the build.
I was getting errors like
Failed to build DependencyGraph: #providesModule naming collision:
Failed to build DependencyGraph: #providesModule naming collision:
Duplicate module name: accepts
Duplicate module name: accepts
I solved it by deleting npm's cache .npm and rerunning packager with --reset-cache
rm -rf ~/.npm
sudo or chown did not fix it for me. I get the same error from the same library, very odd:
Failed to build DependencyGraph: #providesModule naming collision:
Duplicate module name: react-native-vector-icons
Paths: /Users/collumj/research/k9fresh/ios/build/Build/Products/Debug-iphonesimulator/kisharNine.app/package.json collides with /Users/collumj/research/k9fresh/node_modules/react-native/local-cli/core/__fixtures__/files/package.json
No need for sudo when I encounter this.
Warning: destructive, check in first.
rm -rf android ios
git reset --hard
npm start
This fixes it every time. RN 0.39.2
edit: later, I think I fixed this by unlinking the react-native-vector-icons lib; I think the instructions I got made me double up on the linking or were out of date somehow.
After cleaning the nvm cache and reinstalling all node_modules I realized I was having this issue because of react-native-router-flux.
I fixed it with a downgrade from react-native-router-flux#3.38.1 to react-native-router-flux#3.38.0
More details here:
https://github.com/aksonov/react-native-router-flux/issues/1816

Grunt assemble - strange 'module not found' issue

I'm adapting an existing project to use Grunt, Assemble and other workflow tools. I have the workflow working on one machine, but when I try to run the Gruntfile on a different system I get an error:
[/home/ian/workspace/myproject] (master)
ian#ian-desktop $ grunt assemble
Running "assemble:pages" (assemble) task
Warning: Cannot find module '/home/ian/workspace/myproject/node_modules/
grunt-assemble/node_modules/assemble/node_modules/handlebars-helpers/
lib/helpers/home/ian/workspace/myproject/node_modules/grunt-assemble/
node_modules/assemble/node_modules/handlebars-helpers/lib/helpers/code.js'
Use --force to continue.
Aborted due to warnings.
The path that Grunt is trying to load is completely messed up (note the re-occurrence of the cwd about halfway through), but the filename it's looking for - code.js - is installed locally (by npm -i):
[/home/ian/workspace/myproject] (master)
ian#ian-desktop $ find . -name code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
handlebars-helpers/node_modules/remarkable/lib/rules_block/code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
handlebars-helpers/test/code.js
./node_modules/grunt-assemble/node_modules/assemble/node_modules/
handlebars-helpers/lib/helpers/code.js
./node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/
lib/nodes/code.js
Both the systems I'm working on are Ubuntu 14.10, so shouldn't differ in any material way. Node -v gives v0.10.33, npm -v gives 2.1.5. I've tried:
checking out a fresh copy of the entire project from git
clearing all Bash environment vars before running Grunt
I'm having a hard time figuring out what's at the root of the different behaviour of the same code on two similar machines. Other tasks in my Gruntfile seem to be working fine, it's just the assemble task that's broken. Suggestions of where to look, or debug techniques to try, would be very welcome!

Unable to run bonescript files in Cloud9 on BeagleBone

I am having trouble using the Cloud9 IDE to run files which use bonescript on a BeagleBone with the pre-installed version of Angstrom Linux. I am using Cloud9 at http://beaglebone.local:3000 in Chrome 18 on OSX 10.7.
When I run the Bonescript blinkled.js sample code Cloud9 outputs this error:
Output
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/var/lib/cloud9'
at Function._resolveFilename (module.js:326:11)
at Function._load (module.js:271:25)
at Array.<anonymous> (module.js:430:10)
at EventEmitter._tickCallback (node.js:126:26)
If I try adding a file path in the run configuration as suggested in this StackOverflow question I get this error in the Console (in bright red mind you):
[C9 Server Exception 2] undefined
At this point Cloud9 also stops responding and I have to reload the page to attempt to use it further.
If I add "blinkled.js" as the file path I get this error:
'inotify' not loaded
If desired, try installing it with:
curl http://npmjs.org/install.sh | bash
npm install inotify
'fibers' not loaded
If desired, try installing it with:
curl http://npmjs.org/install.sh | bash
npm install fibers
Delay operations loops will consume CPU cycles
Invoke using 'node-fibers' if node version < 0.5.2
No idea what I should put in there.
I've been Googling these various errors for about 24 hours now.
This seems like a great tool, if I can only get it to work. Any ideas?
UPDATE 1
After realizing the opkg had failed to load the required inotify and fibers packages I installed them manually and tried again. Now I get this error on the command line:
# node blinkled.js
gpio: 38 already exported.
{ [Error: EBUSY, resource busy or locked] errno: 10, code: 'EBUSY', syscall: 'write' }
Unable to export gpio: 56
Now I realize there were multiple problems:
First, I should have checked the documentation to get node.js to work. I just assumed alert() was a function when I should have been using console.log(). So once I realized this I was able to run this file in Cloud9:
var hello = "hello world"
console.log(hello);
Second, When I tried to install the libraries (inotify and fibers) using the npm package manager it placed them in the node_modules directory in my working directory:
/home/root/
... not the default Cloud9 root directory as I assumed it would:
/var/lib/cloud9
Third, my pins were already exported, which was fixed by simply restarting the BeagleBone.
Finally, I found that creating a new instance in my home directory with the latest version of bonescript allowed me to run the blinkled.js sample file, as well as this file which tests all analog pins on the BeagleBone from the command line.
You might do a 'git pull' in /var/lib/cloud9 to get an update. One thing I've added is an 'analogRead' function.
i bough beagle bone rev. A4. this kind of error is comming on that also.
i have just make new SD card with latest angstrom image, and then after blinky is working properly.

Resources