Edit: I tried going back to the already-working develop branch and same story. It must be something in node_modules?
I'm working on a KeystoneJS project. I added hooks to one of my lists and the project worked fine.
When I was finished with my work I pushed my work to GitHub and made a pull request for my team. However GitHub complained about a security error (in yarn.lock), so I deleted yarn.lock, reinstalled node_modules(yarn). When I ran the project again locally, however, I received the following error
✔ Validated project entry file ./tsout/index.js
✔ Keystone server listening on port 4545
✔ Initialised Keystone instance
✖ Connecting to database
TypeError: keystone.getResolvers is not a function
at createApolloServer (/Users/r/Documents/projects/yaa-keystone/node_modules/#keystonejs/app-graphql/lib/apolloServer.js:148:25)
at GraphQLApp.prepareMiddleware (/Users/r/Documents/projects/yaa-keystone/node_modules/#keystonejs/app-graphql/index.js:23:20)
at /Users/r/Documents/projects/yaa-keystone/node_modules/#keystonejs/keystone/lib/Keystone/index.js:752:17
at Array.map (<anonymous>)
at Keystone.prepare (/Users/r/Documents/projects/yaa-keystone/node_modules/#keystonejs/keystone/lib/Keystone/index.js:751:12)
at executeDefaultServer (/Users/r/Documents/projects/yaa-keystone/node_modules/#keystonejs/keystone/bin/utils.js:112:42)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
It's throwing the error deep inside the keystone package in node_modules. I deleted and reinstalled node_modules, I reverted my project to a commit from yesterday that worked fine, but I keep getting the same error.
I realise it's hard to say what the issue is, but any help in figuring out how to start tracking this down would be helpful.
This turned out to be an error with new package updates to KeystoneJS conflicting with my code. When I removed yarn.lock and ran yarn it downloaded the latest versions.
Related
As I had installed the Font Awesome dependencies to my app and tried to run npm start right after to test it out, I received this error and it has been super brutal & difficult to resolve.
$ npm start
> portfolio#0.1.3 start
> react-scripts start
~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/css-select/lib/compile.js:31
var token = parse(selector, options);
^
TypeError: parse is not a function
at compileUnsafe (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/css-select/lib/compile.js:31:14)
at Function.compile (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/css-select/lib/compile.js:20:13)
at new Selector (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/renderKid/styles/rule/Selector.js:13:26)
at new Rule (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/renderKid/styles/Rule.js:10:21)
at StyleSheet.module.exports.StyleSheet._setSingleRule (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/renderKid/styles/StyleSheet.js:42:14)
at StyleSheet.module.exports.StyleSheet._setRule (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/renderKid/styles/StyleSheet.js:33:12)
at StyleSheet.module.exports.StyleSheet.setRule (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/renderKid/styles/StyleSheet.js:22:14)
at Styles.module.exports.Styles._setDefaultStyles (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/renderKid/Styles.js:34:25)
at new Styles (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/renderKid/Styles.js:30:10)
at RenderKid.module.exports.RenderKid._initStyles (~/Documents/GitHub/REACT/Portfolio/Portfolio/node_modules/renderkid/lib/RenderKid.js:53:27)
I've checked my package.json file and have my start scripts assigned correctly. I have been at it with this error for nearly a day already.
I have also checked on all my dependencies to make sure they were not outdated. Everything is up to date and still seems to be getting the error.
I have even tried to revert back a few steps from my commits but unfortunately still running into this error so I believe it has to to something with the modules
Try to use an older stable version instead of the new version.
It worked for me..
I changed the version in packet.json and removed node_module folder and
then use npm install again
I am getting the following error when starting my app.
I tried updating node, mongo, and typescript but that didn't help. It was working before until it just stopped suddenly, and I didn't touch any of the files listed in the error.
You can also take a look at tsconfig.json
and tsconfig.build.json
.
How to solve this problem?
After looking on the logs. I would suggest this:
remove node_modules
npm i
try to run project
Mostly error are related to the conflicts. It might be due to the updation of your angular, node and mongoose version.
Hi so we have something interesting happening in our builds.
Nothing regarding the gulp build script changed from our side for one of our projects. But suddenly today when we try to do a pipeline build on one of our repositories we get the following stacktrace error:
Error: Cannot find module './dist-tools/transform.js' from '/opt/atlassian/pipelines/agent/build/node_modules/aws-sdk'
at /opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:128:35
at load (/opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:147:43)
at onex (/opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:172:17)
at /opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:13:69
at FSReqWrap.oncomplete (fs.js:152:21)
Has anyone come accross this before? (we are using node 10.17 for our builds)
We tested the same code from our local builds and get the exact same issue. It seems that something in the aws-sdk package changed?
Since this error suddenly appeared this morning, we looked at our aws-sdk package and updated it to the latest version (2.643.0), but we still get the same error. No code that uses the aws-sdk package has changed.
Also seeing this as of this morning. I find this somewhat sus (adding dist-tools to npmignore).
https://github.com/aws/aws-sdk-js/commit/98c40e64cb7d60927c6a0cec49592fc1fcaa59d7
I wonder if pulling the package directly from GH would resolve.
UPDATE:
I've got a convo going on over here about this https://github.com/aws/aws-sdk-js/issues/3159
We downgraded to the previous version and our issue went away.
I had pushed a node.js react with DApp with web3#1.0.0-beta-41 yesterday (2/6/19) and it worked. Since this morning, when I try to push the same codes it comes up with
web3#1.0.0-beta.42 postinstall
C:\BaandaDev\baandadev-03\client\node_modules\web3
node angular-patch.js module.js:549
throw err;
^ Error: Cannot find module 'C:\BaandaDev\baandadev-03\client\node_modules\web3\angular-patch.js'
(Please disregard baanda ... those are my directory names but the
error is emerging from node modules)
Why is it looking for web3#1.0.0-beta.42 when I am not even asking for it?
I have reduced the version till web3#1.0.0.beta-37 and heroku still looks for beta.42 angular patch (I am not even using angular). The worst thing is ... it worked yesterday.
The only thing I can think of is, Ethereum released web3#1.0.0-beta.42 yesterday. But, it does not explain why heroku would look for a patch for something else.
Interestingly, when I clone the one that is working in heroku in my local machine using something like heroku git:clone -a baandadev03-t2 and then run npm install to re-instead it in my local machine, it throws the same problem in my local machine. However, if I npm i --save webe3#1.0.0-beta.41 manually, it does deploy without a hitch.
Suspect: npm install (generic that install node-modules from package.json is broken for web3 somehow). That is why it is breaking in heroku as well as in local. But, that's a suspect only.
$ git push heroku master (and heroku should push it in and not look for modules I am not asking for).
Likely it is because of web3 npm is breaking. They (web3) have release version web1.0.0-beta.40 to 43 in 3 days. But, I also realized that generic npm install, used for generating node-modules from package.json (node.js), is breaking on web3 on both side. In heroku after push when they try to gen the node-modules. And, when I clone the version from heroku into my own laptop, it cry at the same place (while creating node module at web3). Both places are looking for angular library that it cannot find (I do not know why they would do that - a bug?). And, even when I specify much lower version of web3, it still looks for it that it never did in the past.
I have reported the bug and hope they fix it quickly. I removed all web3 reference from my application and it went into heroku nice and fine. But, that is not good when app depends on smart contracts ... right :)?
I was using module "#nodert-win10-rs4/windows.devices.geolocation" in an electronjs app which was working fine. Later I installed a node module and rebuilt all the modules. Now it stopped working and throwing error. The previous version of that module ( "#nodert-win10-rs4/windows.devices.geolocation") was 1.0.0, Thus I reinstalled it, new version of the module is "0.3.2" but still error. Even i tried this in fresh new electron quick start app and I see the same error. I'm adding here the screenshot of the package.json and the error. (FYI - The module is installed and rebuilt without any error although it has some warning, I've added a screenshot of the installation/built too). Really appreciate any help/suggestions.
I saw other posts with similar errors but I already took the actions mentioned there.
Thanks
Musa
N.B - Cross posted here
I ran into the same issue and here is how I resolved it.
Copy the windows.devices.geolocation into your electron app folder and update the dependencies to point to the location of the folder. You need to this line added to your package.json of your Electron App
"windows.devices.geolocation": "file:windows.devices.geolocation"
Navigate to the newly copied folder and build your NodeRT "addon" to match your Electron version. See this post here NodeRT with Electron
node-gyp rebuild --target=4.0.1 --arch=x64 --dist-url=https://atom.io/download/atom-shell
Run npm install at the the top level Electron app.