How can I deploy node modules in a Meteor app on meteor.com?

后端 未结 7 1601
轻奢々
轻奢々 2020-11-29 02:16

I have an application that uses the node twit module that is available via

npm install twit

I deployed the node module locally from .m

7条回答
  •  伪装坚强ぢ
    2020-11-29 02:34

    Just spent a half hour figuring out the "install npm module inside app/public step and thought I'd save the next person some time. From your app's home directory:

    cd public
    mkdir node_modules
    npm install foo
    

    By default, npm install foo installs "locally," but if there's no node_modules folder in your current directory then it moves up the directory tree looking for one. I was ending up with the package installing in $HOME/node_modules/foo instead of the local project. Fine for localhost, but not so much for deployment.

    (Thanks to npm install locally for solving my root problem.)

提交回复
热议问题