node_modules目录在哪里?

时间:2017-12-19 00:57:05

标签: node.js mongodb

如果我创建一个新的AWS实例(ubuntu 16.04 LTS)并创建一个目录(NodeT),那么运行2个命令:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

(来自https://nodejs.org/en/download/package-manager/

然后我成功安装了node和npm?

node -v
npm -v

返回他们的版本。

那么我是在NodeT上本地创建的还是在整个系统上全局创建的? node_modules目录在哪里?

我正在尝试在系统上安装mongodb并遇到麻烦。我相信我需要跑:

nodejs node_modules/node-sass/scripts/install.js
npm rebuild node-sass

(来自https://github.com/sass/node-sass/issues/1579) 解决我的问题,但命令找不到node_modules目录,我也可以。

我显然错过了nodejs的基本概念。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:2)

在终端中输入此命令

with
  state_table ( people, state ) as (
    select 111, 'TX' from dual union all  
    select 222, 'TX' from dual union all  
    select 333, 'CA' from dual
  ),
  truck_table ( people, dt, color ) as (
    select 111, 1995, 'Orange' from dual union all
    select 111, 1996, 'Blue'   from dual union all
    select 111, 1997, 'White'  from dual union all
    select 111, 2017, 'Blue'   from dual union all
    select 111, 2017, 'Gold'   from dual union all
    select 222, 2006, 'Blue'   from dual union all
    select 333, 2007, 'Blue'   from dual
  )
-- End of simulated inputs (for testing only, not part of the solution).
-- SQL query begins BELOW THIS LINE. Use your actual table and column names
select people
from   truck_table
where  people in ( select people
                   from   state_table
                   where  state = 'TX'
                 )
group by people
having count(case when color != 'Blue' or color is null then 1 end) = 0
;

    PEOPLE
----------
       222

输出(示例):

sudo npm root -g