Coder Social home page Coder Social logo

Comments (14)

jpetitcolas avatar jpetitcolas commented on April 18, 2024 1

Sure.

First, clone the repo admin-on-rest repo locally, and then use a symbolic link on your side project:

cd admin-on-rest
npm link

cd ../my-project
npm link admin-on-rest

Second time I write it today => I open a PR to add this dev tip in the README.

from react-admin.

Kmaschta avatar Kmaschta commented on April 18, 2024

What version of node do you use?

from react-admin.

greg0ire avatar greg0ire commented on April 18, 2024

I use the version that comes with my distribution, I hope it matches the requirements:

node --version
v4.2.6

from react-admin.

Kmaschta avatar Kmaschta commented on April 18, 2024

I recommend you to test with a higher version of node, like 5 or 6.
I'll try to reproduce the issue.

from react-admin.

greg0ire avatar greg0ire commented on April 18, 2024

Thanks, I'll try that tomorrow!

from react-admin.

fzaninotto avatar fzaninotto commented on April 18, 2024

There is a bug in the fetchUtils export in the lib. I'll try and fix that.

from react-admin.

greg0ire avatar greg0ire commented on April 18, 2024

Thanks for fixing this so quickly!

Noob question: how can I try it out? It looks like you can't just specify master as a version constraint for npm, so do I need to rm -rf the module, use git to get the master version, and then run npm install inside the freshly cloned repo? Or is there a simpler way? Or maybe you could just create a new release?

I recommend you to test with a higher version of node, like 5 or 6.

@Kmaschta : I tried it with node v5 and v6 and get the exact same error.

so do I need to rm -rf the module, use git to get the master version, and then run npm install inside the freshly cloned repo?

This strategy does not seem to work out for obscure reasons, so… I'm kind of stuck.

from react-admin.

fzaninotto avatar fzaninotto commented on April 18, 2024

You can use npm ls... @jpetitcolas can you remind me how it works?

from react-admin.

greg0ire avatar greg0ire commented on April 18, 2024

Huh… so the first npm link fails for the same obscure reasons :

Stack trace

sudo npm link
npm WARN optional dep failed, continuing [email protected]
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional dep failed, continuing [email protected]
npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react@^15.0.0
npm ERR! peerinvalid Peer [email protected] wants react@^15.3.0
npm ERR! peerinvalid Peer [email protected] wants react@^0.14.0 || ^15.0.0-0
npm ERR! peerinvalid Peer [email protected] wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer [email protected] wants react@^15.0.0-0
npm ERR! peerinvalid Peer [email protected] wants [email protected] || 0.14.x || ^15.0.0-0
npm ERR! peerinvalid Peer [email protected] wants react@^15.3.0

npm ERR! System Linux 4.4.0-36-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "link"
npm ERR! cwd /home/users/gparis/dev/admin-on-rest
npm ERR! node -v v4.2.6
npm ERR! npm -v 1.4.15
npm ERR! code EPEERINVALID
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/users/gparis/dev/admin-on-rest/npm-debug.log
npm ERR! not ok code 0

I'm using sudo b/c npm link tries to write to /usr/lib/node_modules/admin-on-rest, not sure if this is normal or if there is something wrong with my setup.

from react-admin.

jpetitcolas avatar jpetitcolas commented on April 18, 2024

Documentation proposal submitted: marmelab/admin-on-rest#19

from react-admin.

jpetitcolas avatar jpetitcolas commented on April 18, 2024

I think this is a setup issue. As you sudo the link, npm perhaps ignore your local project dependencies (including React and so on). Not an expert of it. How did you install npm?

from react-admin.

greg0ire avatar greg0ire commented on April 18, 2024

How did you install npm?

I don't remember, but I'll dig into that then. It looks like I installed it with my package manager, then removed it and installed it some other way :

dpkg -l |grep npm
rc  npm                                                         1.1.4~dfsg-2                                                all          package manager for Node.js

UPDATE: Ok so my version of npm was incredibly outdated… (v1.4.15 , and I have v3.10.7 now)

from react-admin.

greg0ire avatar greg0ire commented on April 18, 2024

I followed @jpetitcolas ' guide and managed to run both link commands without errors, the results looks fine:

ls -l node_modules/admin-on-rest
lrwxrwxrwx 1 gparis gparis 52 sept.  7 11:44 node_modules/admin-on-rest -> ../../../../../../usr/lib/node_modules/admin-on-rest
ls -l node_modules/admin-on-rest/
total 44
-rw-r--r--  1 gparis gparis  379 sept.  6 17:48 CHANGELOG.md
drwxr-xr-x  2 gparis gparis 4096 sept.  7 11:10 docs
drwxr-xr-x  2 gparis gparis 4096 sept.  7 11:10 example
-rw-r--r--  1 gparis gparis 1105 sept.  6 17:48 LICENSE.md
-rw-r--r--  1 gparis gparis  325 sept.  6 17:48 Makefile
drwxr-xr-x 37 gparis gparis 4096 sept.  7 11:38 node_modules
-rw-r--r--  1 gparis gparis 1718 sept.  6 17:49 package.json
-rw-r--r--  1 gparis gparis 5162 sept.  6 17:48 README.md
drwxr-xr-x  8 gparis gparis 4096 sept.  7 11:10 src
-rw-r--r--  1 gparis gparis  258 sept.  6 17:48 webpack.config.js

The npm start output, not so :

Error in ./src/posts.js
Module not found: Error: Cannot resolve module 'admin-on-rest/lib/mui' in /home/users/gparis/workspace/dashboard-ui/src
 @ ./src/posts.js 12:11-43

Error in ./src/App.js
Module not found: Error: Cannot resolve module 'admin-on-rest' in /home/users/gparis/workspace/dashboard-ui/src
 @ ./src/App.js 11:19-43

I noticed that there is no lib directory in admin-on-rest, but maybe this should resolve to something else, like node_modules/admin-on-rest/node_modules/material-ui/, which does exist. Maybe I need to run another command? Also what about the requirement in the package.json manifest? Should I remove it? Leave it as is?

from react-admin.

greg0ire avatar greg0ire commented on April 18, 2024

Ok so after some digging it appears that I need to run make build in admin-on-rest to make that work, see #20

from react-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.